On 05/23/13 14:30, Namespace wrote: > On Thursday, 23 May 2013 at 12:29:04 UTC, Artur Skawina wrote: >> On 05/23/13 13:57, Namespace wrote: >>> I know that D has (sadly) no C++ references, but I still think that >>> >>> A a = some_existing_A; >>> >>> should call opAssign. >> >> Not opAssign, but user-defined copy-constructor. But D does not have >> them either... > > That would be a solution.
They are required anyway, for several reasons. Right now, you /can/ do: A a = A(some_existing_A); but, because 'A a = some_existing_A' will bypass your cpctor and call the postblit, it's too dangerous. Unless you mark the latter as @disabled, which of course causes other problems. artur