Re: template specializiation

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

 



Hi Thomas,

Hmmm, unusual situation (for me).

Using...
http://www.comeaucomputing.com/tryitout/

I tend to trust (EDG's front end) Comeau C++'s error message (strict mode, -tused) on this one.

How to unravel this riddle, I'm not sure.  Sorry.

--Eljay

- - - - -
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<c>::b =
{
  &B<d>::b
};
template<>
const A B<d>::b = // Line 21
{
  &B<c>::b
};
- - - - - 

Comeau C/C++ 4.3.3 (Aug  6 2003 15:13:37) for ONLINE_EVALUATION_BETA1
Copyright 1988-2003 Comeau Computing.  All rights reserved.
MODE:strict errors C++

"ComeauTest.c", line 21: error: explicit specialization of member
          "B<c>::b [with c=d]" must precede its first use
  const A B<d>::b = 
                ^

"ComeauTest.c", line 24: warning: parsing restarts here after previous syntax error
  };
   ^

1 error detected in the compilation of "ComeauTest.c".



[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