Skip to search.
Boost-Users · C++ Boost Users

Group Information

  • Members: 645
  • Category: C and C++
  • Founded: Sep 24, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Messages

  Messages Help
Advanced
Why is <boost::function>::_1 not in namespace boost?   Message List  
Reply Message #2880 of 5080 |
Re: Why is <boost::function>::_1 not in namespace boost?

"Peter Dimov" <pdimov@...> writes:

> Historically, conflicts between Bind and Lambda were almost never a problem,
> since there is rarely a reason to use both; the two libraries complement
> each other as Bind is typically used on non-conformant compilers where
> Lambda is not supported.
>
> The long term goal has always been to have one library. Unfortunately, the
> underlying architectures of Bind and Lambda are too different and it's not
> easy to just merge them while still retaining support for MSVC 6, for
> example. So it's a case of "if it ain't broken, don't fix it".

I think I agree with Markus that it is in fact broken. It's easy to
imagine dependency scenarios like this:

lambda <-- libA <-\
}--> App
bind <-- libB <-/

The guy writing App shouldn't have to be aware of the dependency
conflict between libA and libB. Incidentally, MPL had to move all of
its placeholders when it turned out that Boost.Python was using bind.

--
David Abrahams
dave@... * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution




Tue Jan 28, 2003 11:38 pm

dave_abrahams
Offline Offline
Send Email Send Email

Message #2880 of 5080 |
Expand Messages Author Sort by Date

Hi! the placeholders in boost/bin/placeholders.hpp are put in an anonymous namespace. This is awkward, since like this they are visible even in places where I...
Markus Werle
yg-boost-users@... Send Email
Jan 27, 2003
1:53 pm

From: "Markus Werle" <yg-boost-users@...> ... Why would you ever need to use <boost/bind.hpp> and <boost/lambda/lambda.hpp> together? Lambda has its own...
Peter Dimov
boost_pdimov Offline Send Email
Jan 27, 2003
2:01 pm

... Well, I just happen to have a class that a) uses boost::bind, etc to create functors, so ... and b) uses boost::lambda to remove all sort of loops so...
Markus Werle
yg-boost-users@... Send Email
Jan 27, 2003
3:08 pm

... Because writing boost::_1 is a lot of extra typing, and "using namespace boost" is not an option for all users (it brings in a lot of names that might ...
Douglas Gregor
crimsono Offline Send Email
Jan 27, 2003
3:19 pm

From: "Markus Werle" <yg-boost-users@...> ... But why aren't you using lambda::bind _in_ _parallel_ with the other lambda features? Is there a particular...
Peter Dimov
boost_pdimov Offline Send Email
Jan 27, 2003
3:24 pm

From: "Douglas Gregor" <gregod@...> ... might ... Well said, thanks Doug. :-) ... same ... This is definitely the right thing to do in theory; in fact,...
Peter Dimov
boost_pdimov Offline Send Email
Jan 27, 2003
3:34 pm

... Well, assumed I have good reasons to use boost::bind and ::_1 in one case and boost::lambda::_1 in another place in the same file. Now there is a _lot_ of...
Markus Werle
yg-boost-users@... Send Email
Jan 27, 2003
3:53 pm

... You could rename Lambda's placeholders to something that doesn't conflict with Boost.Bind's placeholders: http://www.boost.org/libs/lambda/doc/ar01s05.html...
Douglas Gregor
crimsono Offline Send Email
Jan 27, 2003
4:25 pm

... Well, I got the impression that boost::function stuff has some extra convenience not offered by boost::lambda::bind et. al.. Do I understand You correctly,...
Markus Werle
yg-boost-users@... Send Email
Jan 27, 2003
4:00 pm

From: "Markus Werle" <yg-boost-users@...> ... boost::function is a separate library. It can be used with boost::bind, and it can be used with Lambda. I...
Peter Dimov
boost_pdimov Offline Send Email
Jan 27, 2003
5:04 pm

... Oh, it was just for historical reasons: I built a 2000 line header which creates boost::functions out of compile-time differentiated expression templates...
Markus Werle
yg-boost-users@... Send Email
Jan 27, 2003
9:15 pm

... OK, I retry to say what I mean in a serious way: Wrapping _1, _2 and other placeholders into a named namespace takes 5 minutes and saves a us from a lot of...
Markus Werle
yg-boost-users@... Send Email
Jan 27, 2003
9:15 pm

... I think I agree with Markus that it is in fact broken. It's easy to imagine dependency scenarios like this: lambda <-- libA <-\ }--> App bind <-- libB...
David Abrahams
dave_abrahams Offline Send Email
Jan 28, 2003
11:38 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help