<p><br>
On Apr 16, 2012 5:29 PM, "Namespace" <<a href="mailto:rswhite4@googlemail.com">rswhite4@googlemail.com</a>> wrote:</p>
<p>> That case I would like to prevent, but at the same time allow<br>
> Ivalues. How does that work in D classes?<br>
> As far as I know this operates with structs, but shouldn't it be<br>
> possible with classes and objects too?</p>
<p>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. <br>

</p>