Delayed const variable initialization
ketmar via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jul 13 06:46:38 PDT 2015
On Mon, 13 Jul 2015 09:08:13 +0000, Yuxuan Shui wrote:
> No! What I want to do is to assign to 'const' only ONCE. So it is
> basically an initialization.
it is forbidden to do assigning to `const`. and D has *no* "uninitialized
variable" thingy, even `x = void` is initialization too (in technical
sense). so you want c++-like const, which `Rebindable` does.
> What I really want is to detach initialization from definition.
you can't. it's by design.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150713/177ec2d0/attachment.sig>
More information about the Digitalmars-d-learn
mailing list