Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8419119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:31:25+00:00 2026-06-10T02:31:25+00:00

As I understood pointers to non-static methods, they’re no more useful than for providing

  • 0

As I understood pointers to non-static methods, they’re no more useful than for providing an alias mechanism for a certain method. For example, having an object with three methods

 class Provider
 {
 public:
 int A(int in);
 int B(int in);
 int C(int in);
 }

and a consumer that requires a pointer to a provider method (be it A, B or C). Having a controller that gives a pointer to one of the 3 methods to the so-called consumer, we can write something in the consumer code that uses a Provider instance and the pointer to either A, B or C, depending on what the controller sent.

If this is all that a pointer to a non-static method in C++ can do, is there still a way of providing a more “intelligent” pointer to an object’s method, without sending the object along with that method pointer to a consumer? In the affirmative case, what’s the idiom/mechanism called (even a way to simulate this qualifies as an answer I’m interested in).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:31:26+00:00Added an answer on June 10, 2026 at 2:31 am

    Your concept of member functions pointers is correct in general.

    Member functions pointers are actually very useful with conjunctions to such helpers, as std::bind, or std::function. Raw member function pointers are usually ugly.

    As for your example,

    Your consumer can accept std::function<return_type(args)> and you can pass binding of object and its member function to such consumer.

    such structs as std::bind also allows realization of such concepts as partial specialization and currying.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do not understand pointers. Where can I learn more about them?
As a non-C/C++ expert I always considered square brackets and pointers arrays as equal.
I am trying to understand how to use functional pointers to map the method
... called from a static class and non-main thread. In short, I have a
I understood why a base class pointer is made to point to a derived
I am trying to understand function pointers and am stuggling. I have seen the
I'm beginning and there is something that I don't understand with pointers. I have
I get that asterix is for pointers, and I understand about pointers now. But
I am attempting to understand the c library qsort in the context of pointers
I'm fairly new to C++ and don't quite understand function parameters with pointers and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.