2012-09-06から1日間の記事一覧

Boost.TypeErasure の any は暗黙の型変換が行われない

Boost.TypeErasure の any のコンストラクタは explicit で定義されており、暗黙の型変換が行われません。 これは次のように関数の引数に any を使用する場合に問題になります。 [ソース] #include <boost/type_erasure/any.hpp> #include <boost/type_erasure/operators.hpp> #include <boost/mpl/vector.hpp> #include <iostream> typedef boost::mpl::vect</iostream></boost/mpl/vector.hpp></boost/type_erasure/operators.hpp></boost/type_erasure/any.hpp>…