Boost logo

Boost :

Subject: Re: [boost] traits classes vs. metafunctions
From: Jonathan Wakely (jwakely.boost_at_[hidden])
Date: 2013-03-31 13:46:09


On 31 March 2013 18:31, Stefan Strasser wrote:
>
> I don't understand why they didn't get rid of the "metafunction" concept as
> we use it today entirely, but introduce it into the official standard via
> type traits.
> E.g. via a "constexpr" that can return types, or some other native syntax
> for metafunctions.

And I don't understand why people expect the standard to emerge
perfectly formed from some magic source of an ideal language.

This stuff doesn't just happen by magic, someone has to propose it and
the people involved have limited time and resources.

There are good reasons for the committee to standardise existing
practice instead of trying to invent entirely new tools that noone has
any experience with. The <type_traits> header we have today is
largely based on ideas that got proposed because they were known to
work and were useful in the real world. When <type_traits> was added
to TR1 constexpr didn't exist. When constexpr was added there were no
working implementations to experiment with. Noone suggested replacing
the established metafunctions with constexpr functions in time for
the idea to be understood, implemented and reviewed, and noone made
any formal proposal to make such a change.

If you think there should be something else then get involved and propose it.


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