Curiously recurring template pattern: Difference between revisions

Content deleted Content added
I believe the code is creating an anonymous object, with myStream as an input parameter. We should use normal parenthesis instead of curly brackets.
Make use of static inline in counter example.
Line 71:
struct counter
{
static inline int objects_created = 0;
static inline int objects_alive = 0;
 
counter()
Line 91:
}
};
template <typename T> int counter<T>::objects_created( 0 );
template <typename T> int counter<T>::objects_alive( 0 );
 
class X : counter<X>