|
Boost : |
From: Gabriel Dos Reis (dosreis_at_[hidden])
Date: 1999-12-10 22:53:14
Darin Adler <darin_at_[hidden]> writes:
[...]
| Recently, someone pointed out to me that the swap definition in the above
| code is illegal. I thought that I was specializing a swap function template,
| but in fact this is not possible. As I understand it, there's no such thing
| as a specialization of a function template. It's possible to overload a
| function template, but not specialize it. After hearing this, I am not even
| sure if the syntax is correct in the code above.
I don't know if "someone == me" but I would like to correct the
confusion I've created on this isssue. As Beman pointed in another
article you can *explicitly* specialize swap() in namespace std, but
you can't /partially/ specialize it, as there is no such thing. I was
too imprecise in my earlier posting. Sorry for the confusion.
So as far as I tell tell the first implementation is right, as it
doesn't attempt to "partially" specialize std::swap: it merely
explicitly specializes.
-- Gaby
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk