#include <iostream>
#include <string>
std::string foo() noexcept {
return "foo_free_function";
}
template<typename T>
class Base {
public:
std::string foo() const noexcept {
return "foo_Base_function";
}
};
template<typename T>
class Derived final : public Base<T> {
public:
std::string bar() const noexcept {
return foo();
}
};
int main() {
Derived<int> d;
std::cout << d.bar() << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKc3RkOjpzdHJpbmcgZm9vKCkgbm9leGNlcHQgewoJcmV0dXJuICJmb29fZnJlZV9mdW5jdGlvbiI7Cn0KCnRlbXBsYXRlPHR5cGVuYW1lIFQ+CmNsYXNzIEJhc2UgewoJcHVibGljOgoJc3RkOjpzdHJpbmcgZm9vKCkgY29uc3Qgbm9leGNlcHQgewoJCXJldHVybiAiZm9vX0Jhc2VfZnVuY3Rpb24iOwoJfQp9OwoKdGVtcGxhdGU8dHlwZW5hbWUgVD4KY2xhc3MgRGVyaXZlZCBmaW5hbCA6IHB1YmxpYyBCYXNlPFQ+IHsKCXB1YmxpYzoKCXN0ZDo6c3RyaW5nIGJhcigpIGNvbnN0IG5vZXhjZXB0IHsKCQlyZXR1cm4gZm9vKCk7Cgl9Cn07CgppbnQgbWFpbigpIHsKCURlcml2ZWQ8aW50PiBkOwoJc3RkOjpjb3V0IDw8IGQuYmFyKCkgPDwgc3RkOjplbmRsOwoJcmV0dXJuIDA7Cn0=