Re: template specializiation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thomas,

Would this not work for you?

struct A
{
 const A* a;
};

template <const char* c>
struct B
{
 static const A b;
};

extern const char c[1]="";
extern const char d[1]="";

template<> const A B<d>::b;
template<> const A B<c>::b;

template<>
const A B<c>::b =
{
 &B<d>::b
};

template<>
const A B<d>::b = 
{
 &B<c>::b
};

corey

On 7/7/05, Thomas Neumann <tneumann@xxxxxxxxxxxxxxxxxxxxx> wrote:
> Hi,
> 
> 
> > If a template, a member template or the member of a class template is
> > explicitly specialized then that specialization
> > shall be declared before the first use of that specialization that
> but how would I do this? For functions this is easy, but I don't think I
> can declare a static member variable without defining it at the same
> time. I tried some combinations (using extern etc.), but always got
> compiler errors.
> 
> Thomas
>


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux