2009-04-17から1日間の記事一覧

mpl勉強モード

C++

enable_ifを使ってテンプレートメンバー関数を特殊化してみた? #include <iostream> #include <string> #include <typeinfo> #if defined(__GNUC__) #include <type_traits> #include <cxxabi.h> #endif #if !defined(__GNUC__) template <bool b, class T> struct enable_if; template <class T> struct enable_if<true, T> { typedef T type; }; #…</true,></class></bool></cxxabi.h></type_traits></typeinfo></string></iostream>