On Sunday, 29 December 2013 at 16:22:04 UTC, Ritu wrote:
I have a struct that wraps a class object and lazily initializes it. Now in case the struct instance is passed as an argument to a function and it has not been initialized yet, the default copy constructor and the postblit do not offer a possibility to initialize the class object before copying.

Why this is a problem? You can create function which return class field from struct wrapper and make such function alias this, in addition postblit should allocate new class. The fact that original struct may have null value is irrelevant if copying is made correctly.


Reply via email to