Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53212 - trunk/libs/tuple/test
From: steven_at_[hidden]
Date: 2009-05-23 12:49:33


Author: steven_watanabe
Date: 2009-05-23 12:49:33 EDT (Sat, 23 May 2009)
New Revision: 53212
URL: http://svn.boost.org/trac/boost/changeset/53212

Log:
Avoid ambiguites between std and boost components in C++0x mode. Fixes #3026
Text files modified:
   trunk/libs/tuple/test/another_tuple_test_bench.cpp | 1 -
   trunk/libs/tuple/test/io_test.cpp | 17 ++++++++---------
   trunk/libs/tuple/test/tuple_test_bench.cpp | 3 +--
   3 files changed, 9 insertions(+), 12 deletions(-)

Modified: trunk/libs/tuple/test/another_tuple_test_bench.cpp
==============================================================================
--- trunk/libs/tuple/test/another_tuple_test_bench.cpp (original)
+++ trunk/libs/tuple/test/another_tuple_test_bench.cpp 2009-05-23 12:49:33 EDT (Sat, 23 May 2009)
@@ -23,7 +23,6 @@
 #include <string>
 #include <utility>
 
-using namespace std;
 using namespace boost;
 using namespace boost::tuples;
 

Modified: trunk/libs/tuple/test/io_test.cpp
==============================================================================
--- trunk/libs/tuple/test/io_test.cpp (original)
+++ trunk/libs/tuple/test/io_test.cpp 2009-05-23 12:49:33 EDT (Sat, 23 May 2009)
@@ -27,15 +27,14 @@
 #include <sstream>
 #endif
 
-using namespace std;
 using namespace boost;
 
 #if defined BOOST_NO_STRINGSTREAM
-typedef ostrstream useThisOStringStream;
-typedef istrstream useThisIStringStream;
+typedef std::ostrstream useThisOStringStream;
+typedef std::istrstream useThisIStringStream;
 #else
-typedef ostringstream useThisOStringStream;
-typedef istringstream useThisIStringStream;
+typedef std::ostringstream useThisOStringStream;
+typedef std::istringstream useThisIStringStream;
 #endif
 
 int test_main(int argc, char * argv[] ) {
@@ -79,19 +78,19 @@
   os3 << make_tuple();
   BOOST_CHECK (os3.str() == std::string("()[]") );
 
- ofstream tmp("temp.tmp");
+ std::ofstream tmp("temp.tmp");
 
 #if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
   tmp << make_tuple("One", "Two", 3);
 #endif
   tmp << set_delimiter(':');
- tmp << make_tuple(1000, 2000, 3000) << endl;
+ tmp << make_tuple(1000, 2000, 3000) << std::endl;
 
   tmp.close();
   
   // When teading tuples from a stream, manipulators must be set correctly:
- ifstream tmp3("temp.tmp");
- tuple<string, string, int> j;
+ std::ifstream tmp3("temp.tmp");
+ tuple<std::string, std::string, int> j;
 
 #if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
   tmp3 >> j;

Modified: trunk/libs/tuple/test/tuple_test_bench.cpp
==============================================================================
--- trunk/libs/tuple/test/tuple_test_bench.cpp (original)
+++ trunk/libs/tuple/test/tuple_test_bench.cpp 2009-05-23 12:49:33 EDT (Sat, 23 May 2009)
@@ -21,7 +21,6 @@
 #include <string>
 #include <utility>
 
-using namespace std;
 using namespace boost;
 
 // ----------------------------------------------------------------------------
@@ -274,7 +273,7 @@
   BOOST_CHECK(get<1>(t1) == 'a');
 
   tuple<int, std::string> t2;
- t2 = make_tuple((short int)2, std::string("Hi"));
+ t2 = boost::make_tuple((short int)2, std::string("Hi"));
   BOOST_CHECK(get<0>(t2) == 2);
   BOOST_CHECK(get<1>(t2) == "Hi");
 


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