boost::融合访问联合视图的键类型作为地图

boost::fusion accessing key type of joint view as map

本文关键字:类型 地图 视图 融合 访问 boost      更新时间:2023-10-16

我正在尝试将 ash 框架转换为 c++ 以合并到我的项目中,我的开发环境是 Vista 32 和 Visual C++ 2008 Express,我正在使用boost_1_37_0库,我不打算升级环境,直到我达到一些结果......

鉴于:

typedef Component Pcomponent;
typedef WaitForstart2 Pcomponent2;
typedef boost::fusion::pair<ComponentWONTEXISTS,Pcomponent> component_pair1;
typedef boost::fusion::pair<WaitForstart2,Pcomponent2> component_pair2;
typedef boost::fusion::map<component_pair1> componentDictType1;
typedef boost::fusion::map<component_pair2> componentDictType2;
typedef boost::fusion::joint_view<componentDictType1, componentDictType2>joincomponentDictType;

我无法使用at_key解决如何访问这些类型

boost::fusion::at_key<ComponentWONTEXISTS, dictionaryjoint>(boost::fusion::as_map(dictionaryjoint));

谢谢

PS:我很着急,但我会尝试重新格式化问题一段时间

问候

这很有趣,但我想我设法找到了解决方案:

    typedef boost::fusion::result_of::as_map<boost::fusion::joint_view<componentDictType1, componentDictType2> >::type MAPTYPE;
    MAPTYPE aDict;
    Pcomponent ptempj3 = boost::fusion::at_key<ComponentWONTEXISTS,MAPTYPE>(aDict);