www.digitalmars.com         C & C++   DMDScript  

c++ - Static integral constants can't be used in template specialization

template<bool b>
struct A
{ };

template<>
struct A<true>
{
  static const int value = 0;
};

struct B
{
  static const bool value = true;
};

int main()
{
  return A<B::value>::value;
  // Error: 'value' is not a member of struct 'A<1>'
}


DM doesn't choose the template specialization A<true>.


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw jabber.at
mailto cmeerw at web.de

...and what have you contributed to the Net?
Dec 14 2002