[OT] Modules dropped out of C++17

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 8 12:57:31 PDT 2015


On 08-Jun-2015 22:24, Walter Bright wrote:
> On 6/8/2015 11:17 AM, Paulo Pinto wrote:
>> Apparently modules have been pushed into a Technical Specification,
>> and won't be
>> ready on time for inclusion into ANSI C++ 17.
>>
>> https://botondballo.wordpress.com/2015/06/05/trip-report-c-standards-meeting-in-lenexa-may-2015/
>>
>>
>>
>> So, here is another feature that D wins over C++.
>
> Looks like C++ is adopting ever more D features:
>
>
And they seem to almost have CTFE(!)

 From wiki on C++14:

C++11 introduced the concept of a constexpr-declared function; a 
function which could be executed at compile time. Their return values 
could be consumed by operations that require constant expressions, such 
as an integer template argument. However, C++11 constexpr functions 
could only contain a single expression that is returned (as well as 
static_asserts and a small number of other declarations).

C++14 relaxes these restrictions. Constexpr-declared functions may now 
contain the following:[5]

     Any declarations except:
         static or thread_local variables.
         Variable declarations without initializers.
     The conditional branching statements if and switch.
     All looping statements, including range-based for.
     Expressions which change the value of an object if the lifetime of 
that object began within the constant expression function. This includes 
calls to any non-const constexpr-declared non-static member functions.

goto statements are forbidden in C++14 relaxed constexpr-declared functions.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list