#include <iostream>
#include <string>

class Foo {
public:
    std::string getIt() const {
        return const_cast<Foo *>(this)->getItNonConst();
    }
    
    std::string getItNonConst() {
        return "Foo";
    } 
};

int main() {
    Foo f;
    std::cout << f.getIt();
}