[OT] Modules dropped out of C++17

via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 9 13:25:50 PDT 2015


On Tuesday, 9 June 2015 at 20:01:24 UTC, Walter Bright wrote:
> On 6/9/2015 4:25 AM, "Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= 
> <ola.fosheim.grostad+dlang at gmail.com>" wrote:
>> When constexpr is part of the prototype you know that it isn't 
>> supposed to do
>> substantial work.
>
> That doesn't follow.

What doesn't follow? All my constexpr functions are simple. I 
absolutely don't want to solve N-Queens problems at CT.

>> Without it, you risk the compiler spending a lot of time 
>> computing
>> constants/tables that should be done at runtime to save 
>> compile time and object
>> code size. And since C++ programmers expect that level of 
>> control, it would have
>> ended up as a pragma if it was not part of the language?
>
> This is just made up problems.

Nah, sometimes I want my big lookup tables to be evaluated at 
runtime so I don't get bloated binaries. But neither C++ or D 
cuts it. Because sometimes I want the code that uses constant 
indexing to look it up in the LUT, but actually generate the LUT 
at runtime.

Can D check that a parameter is a CT value so that one can 
overload on it? That would work.


More information about the Digitalmars-d mailing list