|
Boost Users : |
From: Edward Diener (eddielee_at_[hidden])
Date: 2002-07-19 09:27:36
"Peter Dimov" <pdimov_at_[hidden]> wrote in message
news:000501c22f1d$a6fb7690$1d00a8c0_at_pdimov2...
> From: "Edward Diener" <eddielee_at_[hidden]>
> [...]
> > I am using boost::function to implement closures for a Visual C++ 3rd
> party
> > library and suggesting boost::bind as the main way to bind member
> functions
> > to my boost::function implementations. I have even provided some macros
> > which make binding an end user member function to the particular
> > boost::function closures of my classes, using boost::bind, easier. For
C++
> > Builder, as you may know, Borland has a __closure addition to the C++
> > language, totally non-standard C++, which makes the usage of
> boost::function
> > and boost::bind unnecessary.
>
> Borland __closures are, in some ways, more convenient, but function+bind
is
> a more powerful mechanism. __closures need an exact signature match:
Yes, I am aware of the differences. When I said unnecessary I didn't mean in
any way to denigrate boost::function and boost::bind. There is definitely
extra functionality in the boost::bind mechanism over C++ Builder __closures
if the programmer needs it. And of course the boost mechanisms are C++ and
should work on any conforming compiler while C++ Builder's __closure is not
pure C++ and only works in C++ Builder.
Still, having worked with C++ Builder extensively I have found the C++
Builder __closure to be a wonderfully simple concept which corresponds to
something which I have always thought should be part of the C++ language,
which is "pointer to member function of any class". But it does no good to
argue this idea since both Boost, with boost::function+boost::bind, and
Loki, with Loki::Functor, have shown that this concept can be implemented
with template mechanisms, and the rejoinder that it can be done via
templates will always, I believe, mitigate it being accepted as an addition
to the C++ language.
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