CTFE is getting too powerful :o)

Don turnyourkidsintocash at nospam.com
Thu Mar 28 00:34:39 PDT 2013


On Wednesday, 27 March 2013 at 19:43:13 UTC, Dmitry Olshansky 
wrote:
> 27-Mar-2013 23:14, Peter Alexander пишет:
>> On Wednesday, 27 March 2013 at 14:48:32 UTC, Andrei 
>> Alexandrescu wrote:
>>> Found this:
>>> http://stackoverflow.com/questions/15652718/object-error-access-violation-when-printing-result-of-std-algorithm-cartesianpr
>>>
>>>
>>> Soon we'll need to clearly define the limits of CTFE, and 
>>> what happens
>>> when it fails.
>>
>> Aren't the limits just Safe D? (i.e. if it's in Safe D, it 
>> compiles,
>> anything more is implementation defined?)
>
> No - one can call writeln (if one day it's marked @trusted). 
> CTFE can never do such a thing. Plus no access to globals etc. 
> in general sense no side effects.

Actually the relationship between CTFE and SafeD is more 
interesting than that. CTFE can also do some things which safe D 
cannot, eg pointer arithmetic.

Neither is a pure subset of the other.


More information about the Digitalmars-d mailing list