Transitive const sucks

Bruce Adams tortoise_74 at ya.thewho.co.uk
Wed Sep 12 05:59:56 PDT 2007


Janice Caron Wrote:

> Even something as simple as this needs logical const
> 
> class MyMathClass
> {
>     invariant int multiply(int x, int y) /* logically const */
>     {
>         debug logfile.writeLine("multiply.called");
>         return x * y;
>     }
> 
>     debug private Stream logfile;
> }
> 
> You can't tell me that's not a real world need.
> 
> Even something as simple as this needs logical const<br><br>class MyMathClass<br>{<br>&nbsp;&nbsp;&nbsp; invariant int multiply(int x, int y) /* logically const */<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; debug logfile.writeLine(&quot;multiply.called&quot;);
> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return x * y;<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; debug private Stream logfile;<br>}<br><br>You can't tell me that's not a real world need.<br><br>
> 
BTW if there any chance you can change your mail options not to post in both html and text. Every single message of yours is duplicated twice on http://www.digitalmars.com/webnews.

Thanks.



More information about the Digitalmars-d mailing list