#include <iostream>
using namespace std;
struct MyQuestion
{
void fun()
{ cout<<"a"; }
void fun()const
{ cout<<"b"; }
void call()
{
const_this()->fun(); // calls fun() const
fun(); // calls fun()
}
private:
const MyQuestion *const_this() const {
return this;
}
};
int main() {
MyQuestion q;
q.call();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IE15UXVlc3Rpb24KewoJdm9pZCBmdW4oKQoJeyBjb3V0PDwiYSI7IH0KCQoJdm9pZCBmdW4oKWNvbnN0Cgl7IGNvdXQ8PCJiIjsgfQoKCXZvaWQgY2FsbCgpCgl7CgkgICAgY29uc3RfdGhpcygpLT5mdW4oKTsgICAvLyBjYWxscyBmdW4oKSBjb25zdAoJCgkgICAgZnVuKCk7ICAgICAgICAgICAgICAgICAvLyBjYWxscyBmdW4oKQoJfQoKcHJpdmF0ZToKICAgIGNvbnN0IE15UXVlc3Rpb24gKmNvbnN0X3RoaXMoKSBjb25zdCB7CiAgICAgICAgcmV0dXJuIHRoaXM7CiAgICB9Cn07CgppbnQgbWFpbigpIHsKCU15UXVlc3Rpb24gcTsKCXEuY2FsbCgpOwp9