I am currently trying to optimize an objective function over a vector of parameters. To do so, I wanted to use dlib find_min_using_approximate_derivatives type of algorithm. My problem is that the value of the objective function is a very complex function of the vector of parameters, that intermediately modifies many different objects. I tried to include these objects in the class where the objective function is defined, but the problem is that the operator() has to be a const operator in order to...