
12 Jun
2008
12 Jun
'08
9:31 a.m.
Hello, at the moment I'm reading the documentation from Phoenix. Now I have read in the first pages that there are 2 possibilities to define a functor 1) find_if(c.begin(), c.end(), arg1 % 2 == 1) 2) struct is_odd_ { template <typename ArgT> struct result { typedef bool type; }; template <typename ArgT> bool operator()(ArgT arg1) const { return arg1 % 2 == 1; } }; function<is_odd_> is_odd; Okay this 2 possibilities I understand. But There is also written that for much more complex functions the second possibility is more efficient. Can anyone say why this is more efficient? Best regards Hansjörg