Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-04-17 13:40:54


On Wednesday 17 April 2002 02:10 pm, you wrote:
> > operator+ would be great, but it isn't feasible for arbitrary function
> > objects.
>
> Why? What do you mean by "arbitrary function objects"? I was just thinking
> of overloading it for chaining two boost::function<>.
>
> Giovanni Bajo

By "arbitrary function objects" I mean "any type that can be called like a
function". It would be useful if we could have:

  void foo(Person&);
  void bar(Person);

  // ...
  std::list<Person> people;
  std::for_each(people.begin(), people.end(), foo+bar);

That, of course, isn't going to happen because we can't just overload '+' for
every two types in the system :)

And because we can't overload '+' for the general case, I think we shouldn't
overload '+' for just boost::function.

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk