Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

storing mem_fun in a standard container

Is there a way to create a vector< mem_fun_t< ReturnType, MyClass > > ?

The error i'm seeing is:

error C2512: 'std::mem_fun1_t<_Result,_Ty,_Arg>' : no appropriate default constructor available
like image 618
Vargas Avatar asked Jan 22 '23 11:01

Vargas


1 Answers

I really can't see why it would not work, but it's actually a pretty ugly solution. Just take vector<function<ReturnType(MyClass*)>> and be without those issues present in C++03 binders.

like image 53
Johannes Schaub - litb Avatar answered Feb 04 '23 01:02

Johannes Schaub - litb