2004-11-21から1日間の記事一覧

type dispatcher by mpl

#include <boost/preprocessor.hpp> #include <boost/mpl/pair.hpp> #include <boost/mpl/same_as.hpp> #include <boost/mpl/always.hpp> #include <boost/mpl/switch.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/list.hpp> #define TYPE_DISPATCHER_MAX_ARITY 10 struct error_t; template<class T, class F>…</class></boost/mpl/list.hpp></boost/mpl/bool.hpp></boost/mpl/switch.hpp></boost/mpl/always.hpp></boost/mpl/same_as.hpp></boost/mpl/pair.hpp></boost/preprocessor.hpp>

yet another typeof

C++

Arkadiy Vertleyb氏のtypeofエミュレーションの実装は,効率(コンパイル速度)と規模耐性(どこまで複雑な型を扱えるか)がいまいち気に食わない.氏の実装(というか普通に考えられるtypeofエミュレーションの実装)は,型の解析に型の複雑さの2乗オーダー…