2010-06-15から1日間の記事一覧

std::tuple のメタ関数と get をちょっとだけ改良する

C++0x から新たに標準ライブラリに加わった「任意個の値の組」を扱うクラス std::tuple には、 std::tuple_size と std::tuple_element という二種類のメタ関数が用意されています: #include <tuple> #include <string> #include <type_traits> // std::is_same int main() { typedef st</type_traits></string></tuple>…