template function specialization trouble - probably a user error, but...

Nathan Sidwell nathan@codesourcery.com
Fri Sep 17 16:44:00 GMT 2004


Alexandre Oliva wrote:
> On Sep 17, 2004, Nathan Sidwell <nathan@codesourcery.com> wrote:
> 
> 
>>Alan Lehotsky wrote:
> 
> 
>>>template<> inline T::basetype MASK<T>(int width) ....
> 
> 
>>It looks like you're trying to partially specialize a function
>>template.  There is no such thing.
> 
> 
> This is not partial specialization, it's explicit specialization,
> which works for both class and function templates.  What he's missing
> is a `typename' before T::basetype, such that GCC knows it's a
> template-dependent type.
If its a specialization, then it can't have a dependent type.  Adding
typename won't fix things, as there's no 'T' in scope in the first place.

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk




More information about the Gcc mailing list