Explicit specialization in non-namespace scope

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-06-16T10:46:38Z Indexed on 2010/06/16 11:12 UTC
Read the original article Hit count: 322

Filed under:
|
|
template<typename T>
class CConstraint
{
public:
CConstraint()
{
}

virtual ~CConstraint()
{
}

template <typename TL>
void Verify(int position, int constraints[])
{

}

template <>
void Verify<int>(int, int[])
{

}

};

Compiling this under g++ gives the following error:

Explicit specialization in non-namespace scope 'class CConstraint'

In VC, it compiles fine. Can anyone please let me know the workaround?

© Stack Overflow or respective owner

Related posts about c++

Related posts about templates