Logical const

so so at so.do
Mon Nov 29 07:19:08 PST 2010


> Surely I'm not the only person that finds something *incredibly* wrong  
> with this!?

Sorry but I see nothing but the misconception of const-correctness with  
the given example.
I hope you are aware of what you are asking.

For your particular example:
First you started by class, you should use struct. (sorry being lame here  
but happens...)
Second why do mark something const if it is not, this is a wrong approach  
even in C++ which provides explicit "mutable".
How are you going to do caching anyways, if static array is not the case?

struct matrix {
	f32[4][4] m;
	f32 det_cache; // ?
	f32 mag_cache; // ?
	f32 whatever_cache; // ?
};

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list