[Q] about template specialization

Ruslan Shevchenko Ruslan@Shevchenko.Kiev.UA
Sat Apr 25 11:59:00 GMT 1998


look at the next code:

template<class K, class E>
inline
const K& default_key(const E&);

template<class T>
inline
const T& default_key(const T& x)
{
  return x;
}

than, in

template<class K, class E>
class X
{

........

   virtual const K& get_key(const E& x)
    { return  default_key<K,E>(x); }

};

than, lets look on class X<Y,Y>

I think  that  X<Y,Y>::get_key must call specialization (i. e. second
definition)
Actually, in egcs it is wrong.

So, what standart behavior ?

Thanks.


--

    @=
     //RSSH                              mailto:Ruslan@Shevchenko.Kiev.UA






More information about the Gcc mailing list