Boost logo

Boost :

Subject: [boost] An analogue of boost.function with multiple signatures
From: =??B?Smn47SBQYWxl6GVr?= (jpalecek_at_[hidden])
Date: 2009-03-05 18:44:23


I'd like to have an object similar to boost::function, but with multiple
function signatures. Eg. something like that

multifunction<std::string(std::string), float(float), unsigned(unsigned)> mf;
mf=_1 + _1; // I mean boost::lambda::_1
mf("ab"); // should be "abab"
mf((UINT_MAX/2)+1); // should be 0
mf((UINT_MAX/2)+1.0); // should be UINT_MAX+1.0

Would it be possible/feasible to change boost::function to allow this (as
opposed to implementing it separately from boost::function)? Was something
like this even proposed before (I vaguely recall something, but couldn't
google anything useful, so I may be wrong)?

    Jiri Palecek

Boost list run by bdawes at, gregod at, cpdaniel at, john at