typedef std::function<void()> tFun;
std::set<tFun> sFun;
foo1 f1(5, "hello", 3.2f);
foo2 f2();
foo3 f3(4.5);
foo4 f4("doo", "daa");
sFun.insert(f1);
sFun.insert(f3);
sFun.insert(f2);
sFun.insert(f4);
auto it = sFun.begin();
const auto& end = sFun.end();
for(; it != end; ++it)
{
(*it)(); // call their operator ()
}
Error output:
error C2784: 'bool std::operator <(const std::move_iterator<_RanIt> &,const std::move_iterator<_RanIt2> &)' : could not deduce template argument for 'const std::move_iterator<_RanIt> &' from 'const tFun'
....
.... blah, blah irrelevant
There is a problem with set's Compare "predicate" (or how is it called otherwise?) and i don't know how to go about this.
Thank you for your time.







