1

Gosh, when working with mpl libraries, figuring out syntax is a hit-and-miss exerience (previous question ). What is the correct syntax to compare two mpl itterators -i.e., the it != v.end() test ?

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;
   }
}

If I remove the assert the functor compiles and performs fine.

Community
  • 1
  • 1
Hassan Syed
  • 20,075
  • 11
  • 87
  • 171

1 Answers1

2

try boost::is_same<>, that should do the trick.

Nim
  • 33,299
  • 2
  • 62
  • 101
  • I tried that earlier, it wasn't working, I was using `BOOST_STATIC_ASSERT` though. For some reason it is working now. Thanks Nim. – Hassan Syed May 18 '11 at 13:38