Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53061 - trunk/libs/lambda/test
From: steven_at_[hidden]
Date: 2009-05-16 20:25:07


Author: steven_watanabe
Date: 2009-05-16 20:25:06 EDT (Sat, 16 May 2009)
New Revision: 53061
URL: http://svn.boost.org/trac/boost/changeset/53061

Log:
Avoid using namespace std; to prevent ambiguity between boost and std components. Fixes #3025
Text files modified:
   trunk/libs/lambda/test/constructor_tests.cpp | 23 +++++++++++------------
   1 files changed, 11 insertions(+), 12 deletions(-)

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-16 20:25:06 EDT (Sat, 16 May 2009)
@@ -29,7 +29,6 @@
 #endif
 
 using namespace boost::lambda;
-using namespace std;
 
 template<class T>
 bool check_tuple(int n, const T& t)
@@ -212,17 +211,17 @@
 void test_news_and_deletes ()
 {
   int* i[10];
- for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
+ std::for_each(i, i+10, _1 = bind(new_ptr<int>(), 2));
   int count_errors = 0;
 
- for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
+ std::for_each(i, i+10, (*_1 == 2) || ++var(count_errors));
   BOOST_CHECK(count_errors == 0);
 
 
   count_deletes* ct[10];
- for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
+ std::for_each(ct, ct+10, _1 = bind(new_ptr<count_deletes>()));
   count_deletes::count = 0;
- for_each(ct, ct+10, bind(delete_ptr(), _1));
+ std::for_each(ct, ct+10, bind(delete_ptr(), _1));
   BOOST_CHECK(count_deletes::count == 10);
    
 }
@@ -240,16 +239,16 @@
 
 void delayed_construction()
 {
- vector<int> x(3);
- vector<int> y(3);
+ std::vector<int> x(3);
+ std::vector<int> y(3);
 
- fill(x.begin(), x.end(), 0);
- fill(y.begin(), y.end(), 1);
+ std::fill(x.begin(), x.end(), 0);
+ std::fill(y.begin(), y.end(), 1);
   
- vector<pair<int, int> > v;
+ std::vector<std::pair<int, int> > v;
 
- transform(x.begin(), x.end(), y.begin(), back_inserter(v),
- bind(constructor<pair<int, int> >(), _1, _2) );
+ std::transform(x.begin(), x.end(), y.begin(), std::back_inserter(v),
+ 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