2016-12-11から1日間の記事一覧

入れ子にすればN^2個に展開

#include <iostream> template <typename... Ts> int f(Ts... i) { int k = 0; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-value" (... , (i, (... , (++k, i)))); #pragma GCC diagnostic pop return k; } int main() { std::cout << f(0) << std::endl; </typename...></iostream>…