#include <iostream>
class A
{
public:
void funcA()
{
std::cout << "banana" << std::endl;
}
};
int main()
{
A nonconstobject;
nonconstobject.funcA(); //this works
const A constobject; //note the const here
constobject.funcA(); //this gives error: passing ‘const A’ as ‘this’ argument discards qualifiers
}