I'm trying to create a filter_view from fusion map, but can't seem to get the template meta function to work.
So I have a fusion map with a structure similar to this
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/view/filter_view.hpp>
template <typename> struct SetField { };
using IDType = int;
using NameType = std::string;
using TimeField = double;
using namespace boost::fusion;
typedef map<pair<struct ActId, SetField<IDType> >,
pair<struct ActName, SetField<NameType> >,
pair<struct ActStart, TimeField>,
pair<struct ActEnd, TimeField> > ActivityMapType;
I want to create a filter_view the excludes the fields where the second type is a TimeField
int main()
{
ActivityMapType map_;
filter_view<
ActivityMapType const,
boost::mpl::not_<boost::is_same<result_of::second<boost::mpl::_>::type, TimeField>>
> view(map_);
}
The compiler error I get is
/home/mike/boost/boost/fusion/support/pair.hpp: In instantiation of
'struct boost::fusion::result_of::second<mpl_::arg<-1> >':
/home/mike/project/Filter/FusionActivityFilter.h:328:55: required
from here /home/mike/boost/boost/fusion/support/pair.hpp:68:48: error:
no type named 'second_type' in 'struct mpl_::arg<-1>'
typedef typename Pair::second_type type;
I wonder if I'm just using the boost::mpl::_ placeholder incorrectly, I'm new to this meta programming stuff.