天哪,在使用mpl库的时候,弄清楚语法是一个偶然的过程(previous question )。用it != v.end()测试来比较两个mpl测试,正确的语法是什么?
template<typename T>
struct get_type_ordinal
{
rbl_type_ordinal_type operator()()
{
typedef typename boost::mpl::find<rbl_type_mpl_vector,T>::type it;
typedef typename boost::mpl::end<rbl_type_mpl_vector>::type end;
BOOST_MPL_ASSERT_NOT (( boost::mpl::equal_to< it, end >)); // problem here
return it::pos::value;
}
}如果我删除断言,函数器就会编译并正常执行。
发布于 2011-05-18 21:35:25
试试boost::is_same<>,这应该能起到作用。
https://stackoverflow.com/questions/6045273
复制相似问题