fork(1) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. std::string foo() noexcept {
  5. return "foo_free_function";
  6. }
  7.  
  8. template<typename T>
  9. class Base {
  10. public:
  11. std::string foo() const noexcept {
  12. return "foo_Base_function";
  13. }
  14. };
  15.  
  16. template<typename T>
  17. class Derived final : public Base<T> {
  18. public:
  19. std::string bar() const noexcept {
  20. return foo();
  21. }
  22. };
  23.  
  24. int main() {
  25. Derived<int> d;
  26. std::cout << d.bar() << std::endl;
  27. return 0;
  28. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
foo_free_function