I try to call some functions stacked in vector. I did:
DataReader* GPSR_Ptr = new DataReader();
typedef leap::float64 (DataReader::*getFonction)();
std::vector<getFonction> vec (&DataReader::getLat);
But that didn't work.
I try to call some functions stacked in vector. I did:
DataReader* GPSR_Ptr = new DataReader();
typedef leap::float64 (DataReader::*getFonction)();
std::vector<getFonction> vec (&DataReader::getLat);
But that didn't work.
std::vector
has no constructor taking a single value. Use an initializer list :
std::vector<getFonction> vec {&DataReader::getLat};
If you are stuck in 2003, you can also use the filling constructor :
std::vector<getFonction> vec(1, &DataReader::getLat);
But beware that it will copy the parameter, which you may not want for other types.