I have defined new type:
typedef int(* func) (const std::vector<cv::Mat>&, cv::Mat&);
Then I did class member:
std::map< std::string, std::pair<int,func> > functions;
In function, in first line:
pair<funcId,func> functionSet::getRandomFunction() const
{
map<string, pair<int,func>>::iterator it = functions.begin();
std::advance(it, functions.size());
string name = it->first;
func function = it->second.second;
int argumentsNumber = it->second.first;
funcId id = make_pair(argumentsNumber,name);
pair<funcId,func> p = make_pair(id,function);
return p;
}
I got this error:
error: conversion from 'std::map, std::pair&, cv::Mat&)> > ::const_iterator {aka std::_Rb_tree_const_iterator, std::pair&, cv::Mat&)> > >}' to non-scalar type 'std::map, std::pair&, cv::Mat&)> >::iterator {aka std::_Rb_tree_iterator, std::pair&, cv::Mat&)> > >}' requested map>::iterator it = functions.begin();