Boost logo

Boost :

From: Jonathan H Lundquist (jhl_at_[hidden])
Date: 2001-08-22 10:22:50


>
> > From: John Max Skaller <skaller_at_[hidden]>
> > Subject: Re: smart ptr changes
> >
> > c) there is an obvious syntax, with
> > an obvious problem: the obvious syntax is:
> >
> > template<class X>
> > template<class U=X, class V=X>
> > void f(U,V)
> >
> > and the obvious problem is that by extension the
> > correct form for a full specialisation is:
> >
> > template<>
> > template<class U=int, class V=long>
> > void f(U,V)
> >
> > which does not agree with the current <stupid> syntax:>
> >
> > void f(int,long);
>
> Why isn't the obvious syntax:
>
> template<>
> void f<int, long>(int, long)
>
>
> Because it fails to correctly identify
>which template is being specialised in all cases.
>For example:
>
> template<class U, class V>
> void f(U,V); //1
>
> template<class U, class V>
> void f(V,U); //2

Thanks for expounding, but aren't the two above ambiguous anyway without any
specializations?


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