K
kostas
Hi all
I encountered a problem testing a variation of CRTP.
(It's also proposed in "C++ Templates: The Complete Guide" by
Vandevoorde, Josuttis. See the MoreCurious template class in 16.3)
template<class T, template <typename> class D>
class Base
{
protected:
Base(T x): i(x) {}
T i;
};
template<class T>
class Derivedublic Base<T, Derived>
{
Derived(T x):Base<T, Derived>(x){}
};
the problem is that in the Base ctor call (from within Derived ctor)
the Derived parameter is not recognized as class template. Old gcc
versions(3.3.3) could cope with this, but not any more. Other
compilers have also problem.
So is it a language or a compiler issue?
Do you know some workaround?
Any help is appreciated.
Kostas
I encountered a problem testing a variation of CRTP.
(It's also proposed in "C++ Templates: The Complete Guide" by
Vandevoorde, Josuttis. See the MoreCurious template class in 16.3)
template<class T, template <typename> class D>
class Base
{
protected:
Base(T x): i(x) {}
T i;
};
template<class T>
class Derivedublic Base<T, Derived>
{
Derived(T x):Base<T, Derived>(x){}
};
the problem is that in the Base ctor call (from within Derived ctor)
the Derived parameter is not recognized as class template. Old gcc
versions(3.3.3) could cope with this, but not any more. Other
compilers have also problem.
So is it a language or a compiler issue?
Do you know some workaround?
Any help is appreciated.
Kostas