2011-12-15から1日間の記事一覧

::value を短くする

C++

最近、よく使っているんですが、std::integral_constant は、 constexpr operator value_ type() { return value; } を定義しているのでこんな感じで渡すことも出来ます。 [ソース] #include <iostream> #include <type_traits> extern void* enabler; template<bool B, typename T = void> using enabler_if = </bool></type_traits></iostream>…