型の再帰をサポートする mpl::equal のようなプロシージャが必要です。
namespace mpl = boost::mpl;
BOOST_MPL_ASSERT(( mpl::equal<
mpl::vector<int, char>,
typename mpl::push_back<mpl::vector<int>, char>::type > )); // OK
上記は正常にコンパイルされますが、mpl::transform または mpl::fold で使用すると、Visual Studio 2010 rc1 が文句を言います。
typedef mpl::vector<
mpl::vector<int, char>,
mpl::vector<char, char>> type_1;
typedef mpl::transform<
mpl::vector<
mpl::vector<int>,
mpl::vector<char>>,
mpl::push_back<mpl::_, char>>::type type_2;
BOOST_MPL_ASSERT(( mpl::equal<type_1, type_2> )); // FAILS
ただし、これらは機能します...
BOOST_MPL_ASSERT(( mpl::equal<
typename mpl::at_c<type_1, 0>::type,
typename mpl::at_c<type_2, 0>::type> )); // OK
BOOST_MPL_ASSERT(( mpl::equal<
typename mpl::at_c<type_1, 1>::type,
typename mpl::at_c<type_2, 1>::type> )); // OK
mpl::equal が動的に生成された再帰型で機能しないということですか、それとも私の構文に何か問題がありますか?
アドバイスをいただければ幸いです。