我经常想在进行元编程时检查一些类型如integer_sequences,tuples等,并且为每种类型实现打印功能都很麻烦。
是否可以使用clang输出任何值或类型?像___message(something)
?
using is = std::index_sequence<0,1,2,3>;
___message(is)
//prints: std::integer_sequence<size_t,0,1,2,3>
auto tuple = make_tuple(1,2,3);
___message(tuple)
//prints: std::tuple<int,int,int>(1,2,3)