Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 1
    in static_cast<const void*>( &Bar::mem ) ) its not getting the function pointer that fails, but the cast to const void* Commented Jan 12, 2024 at 20:55
  • 2
    please one question per question. Commented Jan 12, 2024 at 20:56
  • 1
    You should think of &Bar::mem as specifying a class offset. It doesn't point to any specific object. Commented Jan 12, 2024 at 21:04
  • 2
    Generally speaking, pointers to data can be stored in a void*; pointers to functions cannot (portably). Commented Jan 12, 2024 at 21:12
  • 1
    Are pointers to non-static member function "formally" not considered pointers Commented Jan 13, 2024 at 2:47