Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c++ - Lazy evaluation and problems with const correctness -


i have made opengl camera class uses lazy evaluation provide final projection or model-view-projection matrices through getter functions. user provides various camera parameters throughout life of instance (fov, position, etc. ), rather have projection matrix and/or mvp matrix recalculated every time parameter changed, 'changed' flag set (i.e. old cached matrix invalid). whenever user requests updated final matrix, recalculated, result cached, , const reference returned.

everything sounds fine until call my:

const qmatrix4x4& oe_glcamera::getmodelviewprojection() const; 

function const oe_glcamera instance... use const references everywhere in app extract camera data cad viewports without changing camera, getter function performs lazy evaluation on member variables if invalid - therefore breaking const-correctness.

is there language feature or design paradigm i'm unaware of this? or lazy evaluation fundamentally incompatible const-correctness? aware of const_cast<>, have never used myself have read few things boil down to: if have use it, have gone wrong somewhere. or saviour?

any advice greatfully received, cam

is there language feature or design paradigm i'm unaware of this?

perhaps, mutable ?

a member of class marked mutable non-const if accessed via reference or pointer owning class const reference or pointer const.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -