mirror of
https://github.com/boostorg/tuple.git
synced 2025-07-30 20:57:15 +02:00
Avoid ambiguites between std and boost components in C++0x mode. Fixes #3026
[SVN r53212]
This commit is contained in:
@ -23,7 +23,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
using namespace boost::tuples;
|
using namespace boost::tuples;
|
||||||
|
|
||||||
|
@ -27,15 +27,14 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
|
|
||||||
#if defined BOOST_NO_STRINGSTREAM
|
#if defined BOOST_NO_STRINGSTREAM
|
||||||
typedef ostrstream useThisOStringStream;
|
typedef std::ostrstream useThisOStringStream;
|
||||||
typedef istrstream useThisIStringStream;
|
typedef std::istrstream useThisIStringStream;
|
||||||
#else
|
#else
|
||||||
typedef ostringstream useThisOStringStream;
|
typedef std::ostringstream useThisOStringStream;
|
||||||
typedef istringstream useThisIStringStream;
|
typedef std::istringstream useThisIStringStream;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int test_main(int argc, char * argv[] ) {
|
int test_main(int argc, char * argv[] ) {
|
||||||
@ -79,19 +78,19 @@ int test_main(int argc, char * argv[] ) {
|
|||||||
os3 << make_tuple();
|
os3 << make_tuple();
|
||||||
BOOST_CHECK (os3.str() == std::string("()[]") );
|
BOOST_CHECK (os3.str() == std::string("()[]") );
|
||||||
|
|
||||||
ofstream tmp("temp.tmp");
|
std::ofstream tmp("temp.tmp");
|
||||||
|
|
||||||
#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||||
tmp << make_tuple("One", "Two", 3);
|
tmp << make_tuple("One", "Two", 3);
|
||||||
#endif
|
#endif
|
||||||
tmp << set_delimiter(':');
|
tmp << set_delimiter(':');
|
||||||
tmp << make_tuple(1000, 2000, 3000) << endl;
|
tmp << make_tuple(1000, 2000, 3000) << std::endl;
|
||||||
|
|
||||||
tmp.close();
|
tmp.close();
|
||||||
|
|
||||||
// When teading tuples from a stream, manipulators must be set correctly:
|
// When teading tuples from a stream, manipulators must be set correctly:
|
||||||
ifstream tmp3("temp.tmp");
|
std::ifstream tmp3("temp.tmp");
|
||||||
tuple<string, string, int> j;
|
tuple<std::string, std::string, int> j;
|
||||||
|
|
||||||
#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
#if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||||
tmp3 >> j;
|
tmp3 >> j;
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace boost;
|
using namespace boost;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -274,7 +273,7 @@ make_tuple_test()
|
|||||||
BOOST_CHECK(get<1>(t1) == 'a');
|
BOOST_CHECK(get<1>(t1) == 'a');
|
||||||
|
|
||||||
tuple<int, std::string> t2;
|
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<0>(t2) == 2);
|
||||||
BOOST_CHECK(get<1>(t2) == "Hi");
|
BOOST_CHECK(get<1>(t2) == "Hi");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user