oracle数据库:BOOST::TUPLE使用简介

oracle数据库    BOOST::TUPLE使用简介

[root@BI ~]# more tup.cpp
#include
#include
#include
#include
#include
using namespace std;

boost::tuple
divide_and_modulo(int a, int b)
{
return boost::make_tuple (a/b, a%b);
}

int main ( )
{
boost::tuple t = divide_and_modulo(8, 2);
cout << t.get<0>() << endl; // prints 4
cout << boost::get<1>(t) << endl; // prints 0

boost::get<0>(t) = 9; // resets element 0 of t to 9
++boost::get<0>(t); // increments element 0 of t
cout << t.get<1>() << endl; // prints 10
cout << t.get<0>() << endl;
cout << endl;

typedef boost::tuple tupstr;
vector v_tup;
string str1("aaa");
string str2("bbb");
v_tup.push_back(tupstr(str1,"b","c"));
v_tup.push_back(tupstr(str2,"g","f"));

cout<::size_type si=0;si!=v_tup.size();++si){

cout<

POSTS