I want to store function pointers with different signature in a std::map as a value. Is this possible in C++
I want to store function pointers with different signature in a std::map as a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
It is possible by using something like Boost.Any or Boost.Variant. Keep in mind, however, that you will have to remember somehow what the signature of the function stored (hidden) inside the
boost::anyobject is, so you can retrieve it.