Documentation bug

Tim Keating holyspamster at gmail.com
Tue Dec 5 19:06:45 PST 2006


The example given describing how to intialize a delegate type (found on
http://www.digitalmars.com/d/type.html) will cause your executable to throw an
access violation if you cut and paste it without modification.

The problem is this line:

    OB o;

I suspect (not being very familiar with the history of the language) that in
the precambrian era, perhaps it was legal to declare an instance of a class
this way (& get default construction), but that seems not to be the case
anymore. The line really needs to be:

    OB o = new OB();

Tim Keating



More information about the Digitalmars-d-bugs mailing list