Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2002-04-25 09:40:29


Paul Mensonides wrote:
> On a similar topic, I think the 'rules' for when type deduction can fail are
> ridiculous. They could easily be rewritten to say something like: template
> type deduction fails if argument replacement results in something nonsensical.
> <-- translated into standardese, of course -- And then follow it with a list of
> things that *are* allowed that normally aren't such as adding 'const' to a type
> that is already const. If we could do that, then we could implement stuff like
> 'has_default_ctor':

The rules in 14.8.2 are meant to prevent (syntactically)
creating invalid types, they are not meant to provide semantic
checks. People feel that the explicit list of reasons for
template deduction failure is needed, because otherwise
each compiler vendor would come up with his own incompatible
list.

I agree that's limiting the possible expressiveness of type traits,
so feel free to participate in the "evolutions" subgroup of the
ISO C++ committee to get an appropriate language extension
into the next standard. I hope an outline for suggestions will
be posted here and on comp.std.c++ in the near future.

Jens Maurer


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