Boost logo

Boost Users :

From: Hansi (hansipet_at_[hidden])
Date: 2008-06-12 05:31:51


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
find_if(c.begin(), c.end(), arg1 % 2 == 1)

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

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at