Time to kill T() as (sometimes) working T.init alias ?

monarch_dodra monarchdodra at gmail.com
Mon Dec 10 08:52:53 PST 2012


On Monday, 10 December 2012 at 11:03:28 UTC, Walter Bright wrote:
> On 12/9/2012 8:17 PM, Jonathan M Davis wrote:
>> Not to mention, unless you can find ways to implement 
>> everything that you'd
>> need a postblit or copy constructor to do without them and get 
>> rid of
>> postblits, doing deep copies is going to be possible. And in 
>> the process of
>> getting rid of postblits, you could easily end up disallowing 
>> other stuff which
>> was useful and innocuous (e.g. something as simple as being 
>> able to print out
>> when an object is copied when debugging).
>
> Have you ever written a struct that requires a deep copy?

The talk deviated to postblit, but in the original argument, the 
entire point of the thread is to have extra support for 
reference-type objects: Objects that are basically nothing more 
than a pointer. You'd have a hard time doing cheaper copy than 
that actually.

Unfortunately, we have a problem regarding their initialization. 
This introduces subtle bugs, redundant "isInitialized" checks, 
ugly implementations etc...


More information about the Digitalmars-d mailing list