VC10 β2にmake_tupleがあるんだ。調べようと調べようと思って忘れていた。
#include <iostream> #include <tuple> using namespace std; int main() { auto t = make_tuple(1, 2, 3); cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << endl; }
>cl /EHsc tuple.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.21003.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. tuple.cpp Microsoft (R) Incremental Linker Version 10.00.21003.01 Copyright (C) Microsoft Corporation. All rights reserved. /out:tuple.exe tuple.obj >tuple 1 2 3