0

How to convert bind to member function pointer

Hi Refer code below: Everything works fine except last line where I wanted to pass argument to member function. I have fn2 which takes one argument to member function pointer. But I want to use bind and provide argument to it and then pass it to fn1 . How to do it? I am doing this because in my actual usecase, I don't have fn2 defined from third party library. https://sololearn.com/compiler-playground/c3zA86vR3NGD/?ref=app

19th Jul 2024, 9:15 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
1 Answer
+ 1
AFAIK converting a <std::bind> result directly to a function pointer in C++ cannot be done. the return value of <std::bind()> returns a callable object of an unspecified type determined by the implementation. which cannot be represented by a simple function pointer.
23rd Jul 2024, 9:40 AM
MO ELomari
MO ELomari - avatar