I'm developing simple simulation library and came across problem, where I have simulation
Time variable, which shouldn't be modifiable by API user (programmer) at any circumstances (just provide information about simulation time), but should be modifiable by simulation library, so it cannot be constant.
This is what i came up with yet but it seems a little bit tricky to me
double simTime; // Internal time, modified by library const double& Time = simTime; // Time info provided for programmer in API
Is there any better approach for this?
const double & you can change your API to provide a function
double getTime(); which returns the value of