Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
它尝试了类似的方法,但不起作用。有没有办法获得类似的效果?
class A { public: int foo(); void bar(int b = foo()); };
是的。重载函数并调用其中的成员函数。
void bar() { bar(foo()); }