* kostas:
> On Apr 20, 12:47 pm, "Alf P. Steinbach" <a...@start.no> wrote:
>> I failed to find anything about it in the standard, but adding the magic
>> word "class" before "Derived" seems to do the trick.
>
> if you mean this:
> template<class T>
> class Derived
ublic Base<T, Derived>
> {
> public:
> Derived(T x):Base<T, class Derived>(x){}
>
> };
>
> it doesn't work for me(gcc 3.4.4 or 4.1.1)
> what compiler do you use?
MSVC 7.1, but now that I checked it with Comeau Online it's evidently an
MS extension, not kosher, so no wonder I didn't find it in the standard.
I don't see any solution to the technical problem, how to refer to
Derived as a general non-specialized template within the Derived class.
However, it shouldn't be difficult to create a workaround at the design
level. E.g., simply move whatever functionality that Base uses in
Derived, to some other class, e.g. another base class of Derived. Or
perhaps you don't really need a template template parameter, perhaps all
that's needed is an ordinary type parameter.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?