Ticket #3026: tuple.patch
File tuple.patch, 2.4 KB (added by , 13 years ago) |
---|
-
another_tuple_test_bench.cpp
23 23 #include <string> 24 24 #include <utility> 25 25 26 using namespace std;27 26 using namespace boost; 28 27 using namespace boost::tuples; 29 28 -
io_test.cpp
27 27 #include <sstream> 28 28 #endif 29 29 30 using namespace std;31 30 using namespace boost; 32 31 33 32 #if defined BOOST_NO_STRINGSTREAM 34 typedef ostrstream useThisOStringStream;35 typedef istrstream useThisIStringStream;33 typedef std::ostrstream useThisOStringStream; 34 typedef std::istrstream useThisIStringStream; 36 35 #else 37 typedef ostringstream useThisOStringStream;38 typedef istringstream useThisIStringStream;36 typedef std::ostringstream useThisOStringStream; 37 typedef std::istringstream useThisIStringStream; 39 38 #endif 40 39 41 40 int test_main(int argc, char * argv[] ) { … … 70 69 os1 << make_tuple(1, 2, 3); 71 70 BOOST_CHECK (os1.str() == std::string("[1,2,3][1,2,3]") ); 72 71 73 ofstream tmp("temp.tmp");72 std::ofstream tmp("temp.tmp"); 74 73 75 74 #if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) 76 75 tmp << make_tuple("One", "Two", 3); 77 76 #endif 78 77 tmp << set_delimiter(':'); 79 tmp << make_tuple(1000, 2000, 3000) << endl;78 tmp << make_tuple(1000, 2000, 3000) << std::endl; 80 79 81 80 tmp.close(); 82 81 83 82 // When teading tuples from a stream, manipulators must be set correctly: 84 ifstream tmp3("temp.tmp");85 tuple<st ring,string, int> j;83 std::ifstream tmp3("temp.tmp"); 84 tuple<std::string, std::string, int> j; 86 85 87 86 #if !defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) 88 87 tmp3 >> j; -
tuple_test_bench.cpp
21 21 #include <string> 22 22 #include <utility> 23 23 24 using namespace std;25 24 using namespace boost; 26 25 27 26 // ---------------------------------------------------------------------------- … … 274 273 BOOST_CHECK(get<1>(t1) == 'a'); 275 274 276 275 tuple<int, std::string> t2; 277 t2 = make_tuple((short int)2, std::string("Hi"));276 t2 = boost::make_tuple((short int)2, std::string("Hi")); 278 277 BOOST_CHECK(get<0>(t2) == 2); 279 278 BOOST_CHECK(get<1>(t2) == "Hi"); 280 279