2009-10-25から1日間の記事一覧

仮想関数があるかどうかの判定

調べたらあったので貼り付け。 boost::is_polymorphic ってのがあるみたいね。 #include template struct is_polymorphic{ struct A : public T{}; struct B : public T{ virtual ~B(){}; }; static const bool value = sizeof(A) == sizeof(B); }; struct h…

/

template typename T > struct dimension{ static const int value = detail::dimension_impl::value>::value; };

vec::dimension

ベクトルの次元数の取得を行います。 #include #include #include "vec/vec.hpp" #include "vec/type_traits/dimension.hpp" #include "vec/preprocessor/make_type_traits_value.hpp" #include "vec/preprocessor/make_type_traits_is_vec.hpp" /** D3DVECT…