#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_io.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <iostream>
#include <string> void TestTuple1()
{
typedef boost::tuple<std::string, std::string> person;
person p("kevin", "");
std::cout << p << std::endl;
std::cout << boost::make_tuple(boost::ref(p), "male", ) << std::endl;
} void TestTuple2()
{
using namespace std;
typedef boost::tuple<string, string, int> person;
person p("kevin", "male", );
cout << p.get<>() << endl;
p.get<>() = "lihua";
cout << boost::get<>(p) << endl;
} void TestTuple3()
{
using namespace std;
typedef boost::tuple<string, string, int> person;
person p1 = boost::make_tuple("kevin","male",);
person p2 = boost::make_tuple("lihua","female",); cout << (p1 != p2) << endl;
} boost::tuple<std::string, int> func()
{
return boost::make_tuple("func error", );
} void TestTuple4()
{
std::string err_msg;
int err_no; boost::tie(err_msg, err_no) = func();
std::cout << "error: " << err_msg << "error no:" << err_no << std::endl;
} void TestShuJuJieGou()
{
TestTuple4();
}