Subject: Re: [boost] traits classes vs. metafunctions
From: Stefan Strasser (strasser_at_[hidden])
Date: 2013-03-31 13:31:49
Am 31.03.2013 16:36, schrieb Dave Abrahams:
> on Sat Mar 30 2013, Nathan Ridge <zeratul976-AT-hotmail.com> wrote:
>>>> why did c++11 choose traits classes over metafunctions, even though
>>>> the concept of a metafunction was introduced in c++11 (<type_traits>).
>>> P.S. Have you seen what they did with enable_if?
>> Do you mean that the standard version takes the condition as a boolean
>> parameter rather than a type parameter? If so, that actually seems
>> more natural to me.
> More natural in some subjective sense but but less interoperable. Oh well.
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk