Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2002-10-27 06:17:05


> I always wondered why we need to struggle that much to dig the information
> from a compiler in writing generic components, while it should be very
easy
> for the compiler to provide direct access to this information. And BTW it
> could give much more then we could achieve now with template tricks.
> Is there formal proposition to the core group to add this kind of
> facility to language? So that I could write something like:
> T.has_default_constructor or T.has_field["member"]

Well there are type traits, which with a little help from the compiler can
do what you want: see
http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1345.html

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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