Boost logo

Boost :

From: Gabriel Dos Reis (dosreis_at_[hidden])
Date: 1999-12-10 22:44:10


Beman Dawes <beman_at_[hidden]> writes:

| 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.

Yes, you're absolutely right.

In the first palce, the issue was to *partially* specialize abs() and
put it in namespace std:: That can't be done. That was my main
point. But I stated it incorrectly; and you're absolutely right to
point out the flaw in my wording.

-- Gaby


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