
On Jul 23, 2:31 pm, Ahmed Charles
std::bind and boost::bind are both monomorphic. phoenix::bind is polymorphic!
Would you (or anyone else) mind explaining polymorphic vs monomorphic in this context? Or point to an explanation?
It took me a while to understand it too. Basically when you bind a function that is originally (statically) polymorphic, you only do it for one of the overloads at a time, that is the bind object is not polymorphic. For example if you have the free functions: double square(double x){return x*x;} int square(int x){return x*x;} and you want to create a boost::lambda::bind from it, you have to choose one of the two overloads first, even if it makes sense to "keep" the two overloads in the bind. phoenix functions work differently and therefore can keep both overloads, which makes a lot of sense. I am sure others will explain it better. Alfredo