Skip to main content

Questions tagged [templates]

2 votes
4 answers
520 views

Threre are two functions FindMaxDistanceVector and FindMaxDistanceList whose implementation is almost same except some debug information added in FindMaxDistanceList. Note that these two functions are ...
user146290's user avatar
1 vote
1 answer
391 views

Is it a good practice to declare a template class, but only with specialized implementations ? Ie, there are many CRC flavours (see https://en.wikipedia.org/wiki/Cyclic_redundancy_check#...
Oodini's user avatar
  • 147
0 votes
1 answer
134 views

HINT: the purpose of this question is to identify downsides for the scenario described. If something is a downside, then it should be quantifiable and it should clearly have a negative impact. ...
pgpb.padilla's user avatar
0 votes
0 answers
93 views

Most template engines have two ways to refer to other templates: Inheritance with blocks (child template inherits from parent template and fills one or more blocks) Includes (parent template includes ...
Toxiro's user avatar
  • 101
-1 votes
2 answers
244 views

What is the best practice, for creating a template repository, and then creating n projects based on that template? With "template" I mean: Let's say the template site is x. So x is a site ...
Divan's user avatar
  • 369
0 votes
2 answers
232 views

I'm a huge believer in the value of Intellisense for showing you what syntax is expected and allowed (and also saving typing, though this is a secondary consideration). When you build a web component (...
Joshua Frank's user avatar
2 votes
1 answer
431 views

I would like to have a class, let's say a queue, that can be specialized to its behavior. For example, let them be a SafeQueue (which disables IRQs before any access) and a FastQueue (which doesn't). ...
JD.'s user avatar
  • 131
1 vote
0 answers
125 views

I came across a class that implements a kind of "strategy pattern" with a concrete implementation defined inside the main class as a template method. #include <iostream> struct ObjA { ...
Delgan's user avatar
  • 376
1 vote
3 answers
4k views

Suppose I have two abstract classes called Color and Animal And I can create classes Green/Red/Blue derived from Color and classes Dog/Cat/Pig derived from Animal at runtime using factory pattern. ...
Xie Qing's user avatar
7 votes
2 answers
3k views

The Java project I am working on currently has a complicated folder structure, and to add a new functionality, one needs to add many .java files in different places in order to let it work in our ...
teamol's user avatar
  • 1
1 vote
1 answer
251 views

Situation I have some existing functions which expect containers which can be iterated and which have certain value_type. The value_type can be a value or some (smart) pointer. All the value_type have ...
ridilculous's user avatar
-3 votes
2 answers
1k views

Is using templates for specifying capacities of containers a good use or misue of the templates? Eg. template <unsigned int Length> class String { public: String(); String(String& ...
user avatar
1 vote
3 answers
337 views

You have the backend for a web application. I'd like to keep this is as disconnected from specific programming lanuages as possible, but if necessary, assume we're talking about PHP. You need to write ...
Lux's user avatar
  • 31
1 vote
2 answers
2k views

When using templates we can have T be any type upon class instantiation. If T is a specific type that needs to be handled differently or in a special way we can specialize or partial specialize that ...
Francis Cugler's user avatar
1 vote
1 answer
224 views

I have a data which is a std::vector of a "small collection" of items of a given type struct Bunny {};. I was vague about "small collection" because for now it's a collection of ...
Enlico's user avatar
  • 130

15 30 50 per page
1
2 3 4 5
9