The line you want is
return (f.*f.do_something)(5);
(That compiles -- I've tried it)
"*f.do_something
" refers to the pointer itself --- "f" tells us where to get the do_something value from. But we still need to give an object that will be the this pointer when we call the function. That's why we need the "f.
" prefix.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…