摘要:
使用: int add(int a, int b) { return a + b; } int main() { std::tuple t = std::make_tuple(1, 2); std::cout 阅读全文
posted @ 2016-10-13 13:05
chxuan
阅读(2220)
评论(0)
推荐(0)
摘要:
方式一:递归 + 类模板特化方式 template struct tuple_printer { static void print(const Tuple& t) { tuple_printer::print(t); std::cout (t); } }; template struct tupl 阅读全文
posted @ 2016-10-13 11:07
chxuan
阅读(996)
评论(0)
推荐(0)
摘要:
使用: 这里用到了C++14的[std::index_sequence][1],std::index_sequence很有用,它可以将std::array和std::tuple转换成序列。 [1]: http://en.cppreference.com/w/cpp/utility/integer_s 阅读全文
posted @ 2016-10-13 10:41
chxuan
阅读(847)
评论(0)
推荐(0)

浙公网安备 33010602011771号