On Tuesday, 9 April 2013 at 16:22:08 UTC, Andrei Alexandrescu wrote:
How do you address construction of immutable objects?


In general, the first assignement of a field in a constructor must be handled as a declaration, not as an assignement. It solve const/immutable construction issues as well as avoiding unecessary copy/destruction as Ali pointed in a recent post.

The magic only happens in the constructor, so it can still be considered as a regular function seen from the outside.

Reply via email to