This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: template function specialization trouble - probably a user error, but...
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: Alan Lehotsky <apl at alum dot mit dot edu>, gcc at gcc dot gnu dot org
- Date: 17 Sep 2004 13:12:55 -0300
- Subject: Re: template function specialization trouble - probably a user error, but...
- Organization: Red Hat Global Engineering Services Compiler Team
- References: <72CB8FCC-089E-11D9-B0E1-003065D56982@alum.mit.edu><414AD810.1000501@codesourcery.com>
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.
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}