Delay allocating class instance in stack.
ANtlord via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Mar 21 22:21:39 PDT 2017
On Tuesday, 21 March 2017 at 12:30:57 UTC, Stefan Koch wrote:
>
> Try scope obj = new MyClass(flag ? 1 : 2);
>
> In essence you should never need to delay construction.
> Just construct the object as soon as you have everything to
> construct it.
> which includes conditions.
Yes I know it. I prepare all input variables before construction
of object usually. I just want to know possibilty of the case
described above.
More information about the Digitalmars-d-learn
mailing list