clear() not implemented as object method?

Thomas Mader thomas.mader at gmail.com
Fri Mar 18 10:13:27 PDT 2011


I just wondered why clear() which is there to call the desctructor of an 
object is implemented as a module function instead of being an object 
method in object_d.
Is there a technical reason for it I don't recognise?

unittest {
     auto b = new Buffer;
     clear(b); // Wouldn't b.clear() be nicer?
}

Thomas


More information about the Digitalmars-d mailing list