Let's say I have a class similar to:
template <typename T>
class MyClass
{
public:
template <typename U>
MyClass(const MyClass<U>&); // Not a copy constructor, as template.
// How to delegate to above constructor?
MyClass(const MyClass& a) : MyClass<T>(a) {}
// ...
};
How to delegate the copy constructors to a (conversion) template constructor?
The code above results in a delegation cycle.
MyClassappears to inconsistently be aclassor aclasstemplate.MyClassis a template and has a template argumentT. It has a converting constructortemplate <typename U> MyClass(const MyClass<U>&);and OP wants to delegate to that from copy constructor. No idea if this is possible tho.: MyClass::MyClass<T>(a) {}