ponce
Don
nospam at nospam.com
Tue Nov 9 14:14:33 PST 2010
bearophile wrote:
> Jonathan M Davis:
>
>> it would be possible to make it so that any objects allocated with
>> new during CTFE would be in the dynamic heap during runtime.
>
> This is possible, but it doesn't seem what you usually desire when you allocate an object at compile time.
>
> Bye,
> bearophile
If it's mutable, it'll go on the heap. If it's immutable, it could
optionally go into read-only memory (it will be exactly like the .init
of a class instance). Classes which are used only during execution of
CTFE functions will not be instantiated at runtime.
More information about the Digitalmars-d-learn
mailing list