Aquivalent References as in C++?

Kevin Cox kevincox.ca at gmail.com
Mon Apr 16 14:33:40 PDT 2012


On Apr 16, 2012 5:29 PM, "Namespace" <rswhite4 at googlemail.com> wrote:

> That case I would like to prevent, but at the same time allow
> Ivalues. How does that work in D classes?
> As far as I know this operates with structs, but shouldn't it be
> possible with classes and objects too?

I would recommend a precondition.  It is a language enforced method of
restricting what values may be passed into a function.  If the code is
compiled for release the checks are not included and do not cost anything.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120416/37500745/attachment.html>


More information about the Digitalmars-d-learn mailing list