Boost logo

Boost :

From: Andreas Pokorny (andreas.pokorny_at_[hidden])
Date: 2006-01-02 13:49:27


Hi there,

I have a slight problem with the construction of a map with fusion::as_map
on an empty view:

#include <boost/fusion/sequence/class/map.hpp>
#include <boost/fusion/sequence/view/filter_view.hpp>
#include <boost/fusion/sequence/conversion/as_map.hpp>
#include <boost/fusion/core/pair.hpp>

struct drop_all {template <typename A> struct apply : boost::mpl::false_ {};};

int main()
{
  using namespace boost::fusion;
  typedef map<pair<int,int>,pair<float,int>, pair<short,int> > my_map;
  typedef filter_view<my_map, drop_all> empty_view;
  typedef meta::as_map<empty_view>::type empty_map;

  my_map source;

  empty_view empty_source( source );
  empty_map obj( as_map( empty_source) );
}

Should I check if the view is empty before running as_map?

I had a related problem, which I am right now unable to minimize.
Somehow filter and transform views seem to call the meta functions with
mpl::void_ and fusion::void_.

Regards,
Andreas Pokorny




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