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()); }