|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53233 - trunk/libs/lambda/test
From: steven_at_[hidden]
Date: 2009-05-24 18:58:52
Author: steven_watanabe
Date: 2009-05-24 18:58:52 EDT (Sun, 24 May 2009)
New Revision: 53233
URL: http://svn.boost.org/trac/boost/changeset/53233
Log:
Avoid ambiguities between boost::lambda::bind and std::bind with VC10. Fixes #3075
Text files modified:
trunk/libs/lambda/test/bind_tests_advanced.cpp | 9 +++++----
trunk/libs/lambda/test/bind_tests_simple.cpp | 4 +---
trunk/libs/lambda/test/bind_tests_simple_f_refs.cpp | 4 +---
trunk/libs/lambda/test/constructor_tests.cpp | 3 ++-
4 files changed, 9 insertions(+), 11 deletions(-)
Modified: trunk/libs/lambda/test/bind_tests_advanced.cpp
==============================================================================
--- trunk/libs/lambda/test/bind_tests_advanced.cpp (original)
+++ trunk/libs/lambda/test/bind_tests_advanced.cpp 2009-05-24 18:58:52 EDT (Sun, 24 May 2009)
@@ -27,7 +27,8 @@
#include <algorithm>
-using namespace boost::lambda;
+using namespace boost::lambda;
+namespace bl = boost::lambda;
int sum_0() { return 0; }
int sum_1(int a) { return a; }
@@ -91,7 +92,7 @@
// This would result in;
// bind(_1 + 1, _1)(make_const(100)) , which would be a compile time error
- return bind(unlambda(f), _1)(make_const(100));
+ return bl::bind(unlambda(f), _1)(make_const(100));
// for other functors than lambda functors, unlambda has no effect
// (except for making them const)
@@ -116,11 +117,11 @@
BOOST_CHECK(call_with_101(_1 + 1) == 102);
- BOOST_CHECK(call_with_100(bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
+ BOOST_CHECK(call_with_100(bl::bind(std_functor(std::bind1st(std::plus<int>(), 1)), _1)) == 101);
// std_functor insturcts LL that the functor defines a result_type typedef
// rather than a sig template.
- bind(std_functor(std::plus<int>()), _1, _2)(i, i);
+ bl::bind(std_functor(std::plus<int>()), _1, _2)(i, i);
}
Modified: trunk/libs/lambda/test/bind_tests_simple.cpp
==============================================================================
--- trunk/libs/lambda/test/bind_tests_simple.cpp (original)
+++ trunk/libs/lambda/test/bind_tests_simple.cpp 2009-05-24 18:58:52 EDT (Sun, 24 May 2009)
@@ -18,9 +18,7 @@
#include <iostream>
-
- using namespace std;
- using namespace boost::lambda;
+using namespace boost::lambda;
int sum_of_args_0() { return 0; }
Modified: trunk/libs/lambda/test/bind_tests_simple_f_refs.cpp
==============================================================================
--- trunk/libs/lambda/test/bind_tests_simple_f_refs.cpp (original)
+++ trunk/libs/lambda/test/bind_tests_simple_f_refs.cpp 2009-05-24 18:58:52 EDT (Sun, 24 May 2009)
@@ -18,9 +18,7 @@
#include <iostream>
-
- using namespace std;
- using namespace boost::lambda;
+using namespace boost::lambda;
int sum_of_args_0() { return 0; }
Modified: trunk/libs/lambda/test/constructor_tests.cpp
==============================================================================
--- trunk/libs/lambda/test/constructor_tests.cpp (original)
+++ trunk/libs/lambda/test/constructor_tests.cpp 2009-05-24 18:58:52 EDT (Sun, 24 May 2009)
@@ -29,6 +29,7 @@
#endif
using namespace boost::lambda;
+namespace bl = boost::lambda;
template<class T>
bool check_tuple(int n, const T& t)
@@ -248,7 +249,7 @@
std::vector<std::pair<int, int> > v;
std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
- bind(constructor<std::pair<int, int> >(), _1, _2) );
+ bl::bind(constructor<std::pair<int, int> >(), _1, _2) );
}
int test_main(int, char *[]) {
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk