It’s possible in GCC, but the way it’s documented in C++ language extensions section suggests there’s no portable way to do it.
You can do two things:
- If you control the class, create a non-virtual function and a virtual wrapper for it and when you know you don’t need virtual dispatch, just take address of the non-virtual one.
- If you don’t, create a template functor that will hold the member pointer and do the explicit scope call.