Topic: using declaration on a templated class


Author: Gilbert Chang <gchang@ccnet.com>
Date: 1998/03/29
Raw View
How do I use using declaration on a templated class?  For example,
consider the following code:

namespace X
{
    template <class T>
    class A
    {
     .....
     };
}

I suppose the using declaration on A should be:

using X::A;

But VC++5.0 complains:
error C2955: 'A' : use of class template requires template argument list

But if I do:

using X::A<int>;
A<int> a;

VC++5.0 still complains:
error C2501: 'A' : missing decl-specifiers

I heard VC++5.0 has lots of scope resolution bugs.  Therefore, I am not
sure I have done the right thing.  g++ 2.8.0 does not implement
namespace at all, so I can't verify it with g++, either. Anybody knows
or would bother to try it with other compilers such as Borland C++?
Thanks.

Gilbert Chang
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]