Meaning of 'const' last in a function declaration of a class?
What is the meaning of `const` in declarations like these? The `const` confuses me.
class foobar
{
public:
operator int () const;
const char* foo() const;
};
The presence of the keyword "const" at the end of the function definition indicates that the function cannot change any class data. The compiler will enforce this constraint.