struct init property

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Aug 23 12:38:07 PDT 2012


On 23-Aug-12 23:33, Namespace wrote:
> But to write your own init property would still be nice, or not?

Either way it has to be CTFEable. Can't you just do:

struct A{
X field = generateX();
}

and thus set .init to whatever you want.
Otherwise it will inevitably rise question of the point of "= x;" syntax 
if initializes are overridden by custom .init.

-- 
Olshansky Dmitry


More information about the Digitalmars-d-learn mailing list