Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
a design structure for creating several things that are almost identical but need different values. Not template-meta-programming.
-1
votes
1
answer
349
views
abstract base classes versus the curiously recurring template pattern [closed]
In my application, the purpose of inheritance is to abstract away complicated logic in the base class template, so that the writer of a derived class template doesn't need to worry about it. … A baby example
#include <iostream>
// option 1
template<typename a>
class base1 {
public:
virtual double f1() = 0;
void f2() { std::cout << f1() << "\n"; }
};
template<typename a>
class derived1 …