Boost logo

Boost :

From: Dietmar Kuehl (dietmar_kuehl_at_[hidden])
Date: 2000-08-30 17:04:58


Hi,
Gary Powell wrote:

> > This should work just fine, and I don't think there is a std namespace
> > problem:
> >
> This is the exact same problem I had with swap.
>
> namespace std {
> template<class T, class S, class R>
> swap(myType<T,S,R>, myType<T,S,R> );
> }

There is a fundamental difference: You are allowed to partially specialize
a template depending on at least one user defined type in namespace std
but you are never allowed to overload a function. Since there is no such
thing as partially specializing a function, only overloading involving
partial
function ordering, it is indeed illegal to provide this 'swap()' method while

it perfectly legal provide teh 'container_gen' specialization (assuming, of
course, that 'container_gen' happens to be standard name).

I'm pretty sure that the rule against overloading will be relexed prior to
the
next revision of the standard... It is just an error which, unfortunately,
probably does not qualify as a defect (at least I can imagine very well which

library vendor would fight it...).


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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