Pointer semantics in CTFE

Walter Bright newshound2 at digitalmars.com
Fri May 25 16:09:32 PDT 2012


On 5/24/2012 11:50 PM, Don Clugston wrote:
> Opinions?


My experience with such special cases is that users lose the ability to reason 
about what code will work in CTFE and what will not. Its operation will become a 
magical, unknowable black box. Meanwhile, you'll be endlessly chasing more 
special cases and rainbows.

I suggest not supporting it unless it can be done in the general case.

One solution might be to attach to each CTFE pointer a reference to the object 
it is pointing into. Then, pointer comparisons within the same object can work, 
and comparing pointers from different objects can explicitly and predictably be 
not supported.


More information about the Digitalmars-d mailing list