Hi all,

got a question about about a static data in a template of template ; this
code does NOT compile under VC++ .NET 2002 :

template<template<typename> class C1, class C2>

class Test
{
public:
Test() { m_i = 1; }

static int m_i;
};

template<template<typename> class C1, class C2>
int Test<C1, C2>::m_i; // ERROR

this seems to be due to the fact that a template of template does not allow
external declarations, so, no way to use static data :(

can anyone tell me if this has been fixed in the 2003 edition ?

tia.

Re: 2002 Vs. 2003 by David

David
Tue Dec 16 06:43:28 CST 2003

>can anyone tell me if this has been fixed in the 2003 edition ?

I pasted your code snippet into a console application in VS2003 and it
compiled cleanly.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Re: 2002 Vs. 2003 by Le

Le
Tue Dec 16 06:50:06 CST 2003


"David Lowndes" <davidl@mvps.org> a écrit dans le message de news:
2evttvcgeiuglrov93fa08vmpfsvpmjq1i@4ax.com...
> >can anyone tell me if this has been fixed in the 2003 edition ?
>
> I pasted your code snippet into a console application in VS2003 and it
> compiled cleanly.
>
> Dave
> --
> MVP VC++ FAQ: http://www.mvps.org/vcfaq

thanks a lot :)
currently, I have no choice but not using static in my template/template...
I'll have to upgrade to version 2003...