To be able to call a function on a const
object, you need to promise the compiler that the function will not modify the object. To do that, you mark the function with the keyword const
after its argument list. For example, to make getDimension
a const
member function, you would change it to:
const ULL getDimension() const { return dimension; }
(Note that the const
in the return type will have absolutely no effect, so you should get rid of it)