tupleの要素参照
TR1のtupleにはメンバ関数版のget
#include <string> #include <boost/tr1/tuple.hpp> // C++0xでは<tuple> using namespace std; using namespace std::tr1; int main() { tuple<int, int, string> person = make_tuple(1, 22, "Akira"); ++person.get<0>(); // エラー! ++get<0>(person); // OK return 0; }