Passing a C++ Member Function Pointer to an STL Algorithm
问题 I have a member function as follows: class XYZ{ public: float function(float x); private: float m_DensityMin; float m_DensityMax; }; Now, I'm trying to transform a std::vector<float> foo using the std::transform STL algorithm by passing the member function function , and storing the resulting values in a vector bar . If I use the function as a global function, with random data that should denote the member variables of the class, it works fine. However, as the function requires the use of