C++17 is feature complete
Ola Fosheim Grøstad via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jun 27 08:24:10 PDT 2016
On Monday, 27 June 2016 at 14:19:16 UTC, jmh530 wrote:
> On Sunday, 26 June 2016 at 22:32:55 UTC, Walter Bright wrote:
>> On 6/26/2016 10:18 AM, Enamex wrote:
>>> - template arguments that accept constant values of any
>>> type whatsoever
>>> 'template<auto Arg>';
>>
>> Still adding D features, I see!
>
> constexpr if looks a lot like static if to me.
I don't think it is like static if. AFAIK it cannot turn off
member fields and it cannot turn off static_asserts. "if
constexpr" is primarily for preventing instantiation issues, so
it does not introduce a separate compilation stage like in D.
In C++ this will fail to compile:
if constexpr(false){
static_assert(false);
}
More information about the Digitalmars-d
mailing list