Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-12-10 20:32:37


At 11:18 PM 12/10/99 +0100, Gabriel Dos Reis wrote:

| Programs are definitely allowed (and recommended) to specialize
function
| templates like std::swap and std::less; in fact my recent change to
| smart_ptr.hpp does just that.

>Stop. You can't specialize a template function. You *overload* it.
Two
>differents things; althought they might be seen as having similar
>effects.

Huh?

14.7 [temp.spec] Template instantiation and specialization (para 3)
says:

     An explicit specialization may be declared for a function
template,
     a class template, a member of a class template or a member
template.

The standard goes on to give many examples of specialized function
templates. Also see 14.7.3.

Perhaps what you meant was "You can't *partially* specialize a
function template." That is correct AFAIK.

Cheers,

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk