光阴似箭催人老,日月如移越少年。
There is no particularly good way. You can call a const member function through a temporary const reference.
int main() { A a; const A& b = a; b.getI(); }
There is no particularly good way. You can call a const member function through a temporary const reference.