Boost logo

Boost :

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

From: "John Max Skaller" <skaller_at_[hidden]>
> > >
> > >
> Be interesting to see the proposed syntax.

> 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, gregod at, cpdaniel at, john at