AnsweredAssumed Answered

Template partial specialization

Question asked by kenfred on Oct 19, 2011
Latest reply on Oct 24, 2011 by GrahamA

Hello,

 

I am attempting to do a specialization on a member of a class, but receive an error.

 

A simplified class defintion that demonstrates what I'm trying to do:

 

template<unsigned int width, unsigned int height>

class myClass

{

     static int val;

};

 

template<unsigned int height>

int myClass<5, height>::val = 3;

 

template<unsigned int height>

int myClass<1, height>::val = 6;

 

 

As another example, see the last example on the following page:

http://www.cprogramming.com/tutorial/template_specialization.html

 

The error received when compiling: cc0498:  error: template argument list must match the parameter list.

 

Is this a compiler bug?

 

Thanks.

Outcomes