How does compiler work internally to make sure constant object can access only constant member function ?