I am attempting to create a fusion map which looks like:
map< pair, pair >
I am then attempting to find out if *field1 *exists in the map using *has_key,
*but am getting a compile error:
error: no type named ‘category’ in ‘struct
boost::fusion::result_of::as_map, boost::fusion::pair > >
Can anyone offer insight on what I'm doing wrong?
I have a simple example below:
#include <iostream>
#include
#include
#include
#include
#include
namespace fusion = boost::fusion;
namespace mpl = boost::mpl;
*// given a field, returns a fusion pair of *
template<class field>
struct make_pair
{
typedef typename fusion::result_of::make_pair::type type;
};
*// given a sequence of fields, returns a fusion map which maps field ->
field::type*
template<class fields>
struct make_map
{
typedef typename mpl::transformmpl::_1>::type
pair_sequence;
typedef typename fusion::result_of::as_map type;
};
*// sets boolean value to true if field is in fields*
template
struct contains_key
{
typedef typename boost::fusion::vector vector;
typedef typename make_map<vector>::type map;
typedef typename fusion::result_of::has_key