I understand that calling a non-const method to a constant object gives an error as explained here. This question, although deals with the same error, is not