Is it possible to write template definition for this data type?
myclass<int, myclass<int> > data;
Second template variable should be optional with default value of the same type.
Clarification
Now I use this definition:
class defaultClass { };
template <typename T, typename C=defaultClass>
class myclass { ... };
I’d like to predefine that defaultClass is myclass<T>
I’d like to implement something like auto implemented properties: the second parameter should be context in which the wrapped variable is defined. If the context is ommited, it should be in the object created by the template class itself. (I realize it could be solved another way, this is just use case.)
Looks very similar to
http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern
You can do the thing you want by making a class hierarchy with template base type and then each of your classes may be derived from that base like