This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: C++ templates: precisions
Yes, you're right. But why is it ??
Does the compiler go further to 'cache' a pre-compilation of the template in
case of class ?
----- Original Message -----
From: "Sebastian Huber" <sebastian-huber@web.de>
To: <gcc-help@gcc.gnu.org>
Sent: Sunday, January 12, 2003 12:02 PM
Subject: Re: C++ templates: precisions
Hello!
On Sunday 12 January 2003 11:25, erwan ancel wrote:
> well, this is my problem:
>
> I would like to make a template class that owns a set of elements that
have
> the type of one of the class parameters. And it doesn't compile...
> example:
>
> #include <set>
> template <class T>
'template<typename T>' may fix your problem.
> class A
> {
> public:
> A();
> B();
> std::set<T> _list;
> };
>
> the compiler's output tells that the type T is not defined... Well, of
> course, but it will be defined when the template will be instanciated. So
> it should be possible...
> Does anybody know a solution to my problem?