1 2 3 4 5 6 7
#include "bar.hpp" #include <iostream> int bar(Foo *foo) { std::cout << "bar" << std::endl; return (foo == nullptr) ? -1 : foo->foo(); }