Boost logo

Boost :

Subject: [boost] [fusion] inconsistency in size metafunction
From: Jean-Louis Leroy (jl_at_[hidden])
Date: 2009-09-27 09:25:20


Consider :

#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/push_back.hpp>
#include <boost/fusion/include/size.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>

int main() {
   using namespace boost;
   using namespace fusion;
   typedef vector<int, int> seq1;
   typedef result_of::push_back<vector<int>, int>::type seq2;
   BOOST_MPL_ASSERT((is_same<result_of::size<seq1>::type,
result_of::size<seq2>::type>));
}

One would not expect this to fail, however it does :

'boost::mpl::assertion_failed' : cannot convert parameter 1 from
'boost::mpl::failed ************boost::is_same<T,U>::* ***********' to
'boost::mpl::assert<false>::type'
1> with
1> [
1> T=boost::mpl::int_<2>,
1> U=boost::mpl::integral_c<int,2>
1> ]

J-L


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk