Ruling out arbitrary cost copy construction?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Fri Oct 29 12:02:11 PDT 2010
On 10/29/10 13:19 CDT, Jonathan M Davis wrote:
> I'm arguing that you do _not_ define those and that you let user code fend for
> itself. If a programmer is foolish enough to write code with overly expensive
> postblit constructors, then they're just shooting themselves in the foot.
I think it would be hasty to classify them as foolish. Expensive copy
constructors are meant to protect an abstraction, not some questionable
practice. In brief your stance gets back to refcounting: a programmer
must choose to use refcounting whenever they have expensive state to
manipulate.
Andrei
More information about the Digitalmars-d
mailing list