Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2000-11-01 15:48:48


From: "David Abrahams" <abrahams_at_[hidden]>

> > Once you allow std:: overloads, many more such examples can be
> > constructed. And I wonder how exactly you'd constrain those
overloads to
> > match the primary template in functionality, whatever the definition
of
> > "match."
>
> I think you could use similar hand-waving to what is used for explicit
> specialization.

The precise language used in that "hand-waving" is important, because it
may open the door to much more 'evil' examples than that swap(b, d)
thing.

> > Granted, but note that the problems are not limited to partial
> > specializations. They are already there. In particular, the partial
> > specialization syntax doesn't allow omitting the template
parameters, so
> > your example is a non issue.
>
> I don't think so. Full specialization is just a special case of
partial
> specialization. The dangerous syntax lies along the continuum of the
> technique you are proposing people should use.

Sorry, I lost you there. Full specialization is a special case of
partial specialization. What does this prove?

Further, I am proposing something people should use? No, not really. I
showed how to add function template partial specializations to the
language mainly because the standard already specifies that
specializations are the way to extend library templates. (This feature
has other valid uses as well.)

The "dangerous syntax" is already in the language; partial
specializations don't add any more dangers to it.

In fact, I expressed the opinion that the dangerous syntax ought to be
deprecated/removed; although this, unlike the other proposal, would
break existing code.

--
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