Questions tagged [templates]
The templates tag has no usage guidance.
6
questions with no upvoted or accepted answers
1
vote
0
answers
102
views
Is it bad practice to specialize template method to implement strategy pattern in C++?
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 {
...
1
vote
2
answers
162
views
Design for generating/filling a document based on a template-file, while considering permissions from a database?
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 ...
1
vote
0
answers
502
views
Dependency injection in the template class
I have a template wrapper class around the container std::priority_queue that supports multithreading. The short version of it is below. In this class I employ the function IsReady() that checks ...
0
votes
0
answers
75
views
What is the use case for blocks in template engines?
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 ...
0
votes
0
answers
44
views
Template engine design question?
I don't know if this is the proper forum for the question as any answers will be rather subjective. But here it goes, please advise if there is a better place to ask this.
I am designing a small ...
0
votes
0
answers
250
views
c++ templates - combining deduction with default template arguments
I have a simple class (details here)
namespace MemoizerSupport {
template <typename T1, typename T2>
using DEFAULT_CACHE = LRUCache<T1, T2>;
}
template <typename RESULT, ...