2011-01-26から1日間の記事一覧

論理演算

C++

あると便利だと思うのですが、C++0xにはありません。 #include <type_traits> // and template <class ...Fs> struct and_ : std::true_type {}; template <class F1, class ...Fs> struct and_<F1, Fs...> : std::conditional<F1::value, and_<Fs...>, std::false_type>::type {}; // or template <class ...Fs> struct or_ : std::false_type {}…</class></f1::value,></f1,></class></class></type_traits>

を少し実装してみた

C++

C++0xのは型に関する情報を取得する重要なライブラリで、GCC4やVC10でも実装が提供されています。しかしそのうちのtype propertiesに関しては、N3225で大幅に変更されたこともあり、未実装の部分が多く残っています。 そこで、GCC4.6.0(20110122)を使い、未…