Boost logo

Boost :

From: John Max Skaller (skaller_at_[hidden])
Date: 2001-08-20 19:43:32


Peter Dimov wrote:

> You are right; in fact this applies a lot more to full specializations:
>
> template <class T> int f(T, int);
> template <class T> int f(int, T);
>
> template<> int f<int>(int, int) { /*...*/ }
>
> (CWG open issue #285.) Partial specializations, AFAICS, don't suffer from
> this problem.

        Yes, they do (not for classes of course, and partial specialisations
for function doesn't exist, so you are correct if you are refering to
the
current Standard: you are right 'in vacuo' :-)

        You only need to add an extra parameter
which is not specialised to your above code to get an example:

        template <class T, class U> int f(T,int,U);
        template <class T, class U> int f(int, T, U);
        template<class U> int f<int,U> f(int,int,U);

That's exactly the same problem with the same example, just adding
an extra non-specialised parameter U.

-- 
John (Max) Skaller, mailto:skaller_at_[hidden] 
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
New generation programming language Felix  http://felix.sourceforge.net
Literate Programming tool Interscript     
http://Interscript.sourceforge.net

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