LeMonADE-project / LeMonADE

Library for Monte Carlo Simulation applying the Bond Fluctuation Model
Other
3 stars 11 forks source link

Compiler errors about const specifier in getter functions #127

Open tonimueller opened 3 years ago

tonimueller commented 3 years ago

A lot of getter functions are written like

const type getValue() const {return value;} 

where the compiler complains about the first const . (https://stackoverflow.com/questions/21478342/c-const-in-getter https://arne-mertz.de/2016/07/const-correctness/) The correct way would be to write

type getValue() const {return value;} 

which does not alter the state of the object.