L
Levent
Please consider the following Parent and Child template classes:
template <class T>
class Parent {
public:
typedef T type;
typedef T& ref;
/* pack of typedefs */
};
template<class T>
class Child: public Parent<T>
type data;
public:
ref get() {return data;}
};
(gcc) warning: `Child<T>::type' is implicitly a typename
implicit typename is deprecated
(same for ref)
which emphasizes the use and importance of `typename' keyword and is
great, unlike MS compiler.... And thus I guess, above code is not
acceptable according to the standards...
But, where does the typename supposed to appear for derived typedefs
(without listing them all over again in Child)?
template <class T>
class Parent {
public:
typedef T type;
typedef T& ref;
/* pack of typedefs */
};
template<class T>
class Child: public Parent<T>
type data;
public:
ref get() {return data;}
};
(gcc) warning: `Child<T>::type' is implicitly a typename
implicit typename is deprecated
(same for ref)
which emphasizes the use and importance of `typename' keyword and is
great, unlike MS compiler.... And thus I guess, above code is not
acceptable according to the standards...
But, where does the typename supposed to appear for derived typedefs
(without listing them all over again in Child)?