Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-20 08:02:37


From: "John Max Skaller" <skaller_at_[hidden]>
> > > http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226
> > > http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1296.htm
>
> Be interesting to see the proposed syntax.

http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1295.htm

> Here's mine:
>
> // primary template
> template<class T, class U> void f(T,U);
>
> // specialisation
> template<class X> template<class T=X, class U=X> void f(T,U);
>
> There isn't any alternative to fully repeating the whole
> signature. Unless I'm mistaken, this ALSO applies to
> full specialisations, which means the current syntax is
> plainly wrong.

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.

I didn't try to fix the current syntax, though, merely to extend it.

--
Peter Dimov
Multi Media Ltd.

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