Avoid ambiguites between std and boost components in C++0x mode. Fixes #3026

[SVN r53212]
This commit is contained in:
Steven Watanabe
2009-05-23 16:49:33 +00:00
parent 08277fd057
commit e89ea11d63
3 changed files with 9 additions and 12 deletions

View File

@ -23,7 +23,6 @@
#include <string>
#include <utility>
using namespace std;
using namespace boost;
using namespace boost::tuples;

View File

@ -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 @@ int test_main(int argc, char * argv[] ) {
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;

View File

@ -21,7 +21,6 @@
#include <string>
#include <utility>
using namespace std;
using namespace boost;
// ----------------------------------------------------------------------------
@ -274,7 +273,7 @@ make_tuple_test()
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");