I'm trying without success to use a boost::bind with a boost::factory
I have this class Zambas with 4 arguments (2 strings and 2 ints) and
class Zambas {
public:
Zambas(const std::string&, const std::string&,int z1=0,int z2=0) {
if (z1==z2){
}
}
};
inside other method i have the following call
boost::function<Zambas*()> f(boost::bind(boost::factory<Zambas*>(), std::string(""), std::string(""),_1,_2));
that fails with the following compiler error:
bind.hpp:382: error: no match for ‘operator[]’ in ‘a[boost::_bi::storage3<A1, A2, boost::arg<I> >::a3_ [with A1 = boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, A2 = boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int I = 1]]’
What I'm doing wrong ?