Boost logo

Boost Users :

From: Foster Gareth (gareth.foster_at_[hidden])
Date: 2005-09-21 11:04:08


Hello all,

Take for example, a situation where, in psuedo code of course, I want to do
this sort of thing ...

"
  class A {
    void wee();
  }

  container<A> as;
  for_each(in as, a::wee());
"

I did a little google work on this and found this amazing flame war between
a Java user and a Boost/C++ user:
[
http://episteme.arstechnica.com/groupee/forums/a/tpc/f/6330927813/m/26500301
5731 ]

It seems from this that we, as c++ users, have as options:

* writing a new functor to call methods
* using std::mem_fn
* using the boost enhancements to the above

I get the impression that boost bind and lambda are relevent here, although
I've only glanced at examples.

What interests me is the anonymous methods / class style syntax that Java
offers. I've played with it myself, and it seems nice, and one of the
proponents in the afore mentioned flame war advocates it.

What is the thinking behind not introducing such syntax into C++? I am sort
of working from the assumption that the template solutions (as opposed to
language modification solutions) in boost at the moment, will be moved into
std:: and offered as a solution rather than an update to the language. It
may be that I have the wrong end of the stick there, and that the boost
solutions are a temporary solution. It may also be there are good reasons to
prefer the template style solution. It may also be I am talking tripe :)

Anyway, I hope this doesn't make a mountain out of a mole hill. I'm just
wondering about the decisions that have been / are likely to be made, in
this area. I don't claim to hold any opionion on the matter, other than "I
think it is an interesting matter" :)

Thanks all,

Gaz

**********************************************
* http://www.mozilla.org/products/firefox/ *
**********************************************


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net