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

  • Home
  • SEARCH
  • 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 8373739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:45:19+00:00 2026-06-09T14:45:19+00:00

For example, considering the C# Unlike function pointers in C or C++, delegates are

  • 0

For example, considering the C#

Unlike function pointers in C or C++, delegates are object-oriented,
type-safe, and secure.

source:
http://msdn.microsoft.com/en-us/library/aa288459%28v=vs.71%29.aspx

Now talking about the C++ only, what is the real difference and what is missing from an OO prospective?

Also from another source

Most C++ programmers have never used member function pointers, and
with good reason. They have their own bizarre syntax (the ->* and .*
operators, for example), it’s hard to find accurate information about
them, and most of the things you can do with them could be done better
in some other way. This is a bit scandalous: it’s actually easier for
a compiler writer to implement proper delegates than it is to
implement member function pointers!

source:
http://www.codeproject.com/Articles/7150/Member-Function-Pointers-and-the-Fastest-Possible

I find that many programs in C++ uses the ->* syntax, i don’t find that this is bizarre or strange; I don’t get the point about this potential about the delegates and the attack to the pointers.

  • 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-09T14:45:20+00:00Added an answer on June 9, 2026 at 2:45 pm

    I think people find it difficult to write them, but they behave like ordinary pointers, if they are NULL then its wrong to execute them. If they are written and used properly then there is nothing wrong with them. I never really had problems with,maybe besides forgetting proper syntax.

    In c++11, you can use std::function<> class which is a wrapper for function pointer. You can use it for functions, member functions, functions objects and lambdas.

    for example:

    void foo(int x);
    std::function<void(int)> f=foo;
    f(1);
    

    or easier (works in VS2010):

    void foo(int x);
    std::function<decltype(foo)> f=foo;
    f(1);
    

    ref: http://en.cppreference.com/w/cpp/utility/functional/function

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

Sidebar

Related Questions

Considering the example at the end of the question, is the map object going
Considering the fallowing example : function A(obj) { } B.prototype = new A; B.prototype.constructor
Considering a string as follows: string = "<p>Hello World</p><a href="http://example.com">More Examples</a><a href="http://2.example">Even More Examples</a>"
Considering the following javascript example: var myobj = { func1: function() { alert(name in
considering this example: public static void main(final String[] args) { final List<String> myList =
Im considering use CSLA.NET 3.8 for example for Security and Identity Management on a
Considering this example as a base example. I created the application but when I
Considering the following data example : data ={ {a, b, c, d, e}, {1,
Considering I have two arrays for example: String[] array1 = new String[10]; int[] array2=
I was considering adding some extra properties between a has_many relationship. For example, I

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.