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.
print_numは非静的メンバー関数です。つまり、型の暗黙的な最初の引数がありA*ます。たとえば、ラムダを使用してそれを渡すことができます。
print_num
A*
void run() { auto myself = this; setFunction( [myself] (int i) { myself->print_num (i); } ); }
または使用bindしてください、ここを参照してください
bind
c ++オーバーロードされた関数のキャストの問題:<未解決のオーバーロードされた関数型>