Obviously this doesn't work. How should I proceed?
Create another class Wrapper with:
attribut Calibration*
constructor that initialize my pointor to my Calibration class.
Then define a function Wrapper_To_Call_Calibration inside this class?
I tried this but it doesn't work.
Any help please? (but very simple help, I am not expert in C++)...
Obviously this doesn't work. How should I proceed?
It really depends on the argument type that the CSimplex constructor expects. If it takes a plain function pointer, then you can't get around using global/static data. I.e. you can make functionToMinize a static member function and any data it uses too.
If CSimplex is under your control, I suggest you switch to using a boost::function (or std::function if your compiler supports it) instead of a function pointer. They are much more flexible and can easily be used with member functions.
This code may contain errors, it's only to show the idea.
Bookmarks