2012-08-27から1日間の記事一覧

Boost.TypeErasure でダウンキャスト

Concept に typeid_<> を定義することで any_cast を使用したダウンキャストを行うことが出来ます。 [ソース] #include <boost/type_erasure/any.hpp> #include <boost/type_erasure/any_cast.hpp> #include <boost/mpl/vector.hpp> #include <iostream> int main(){ namespace te = boost::type_erasure; te::any< boost::mpl::vector< te::typeid_<>, te::</iostream></boost/mpl/vector.hpp></boost/type_erasure/any_cast.hpp></boost/type_erasure/any.hpp>…