Boost “增压错误”;结构没有名为'的成员;序列化'&引用;虽然结构已序列化

Boost “增压错误”;结构没有名为'的成员;序列化'&引用;虽然结构已序列化,boost,boost-serialization,Boost,Boost Serialization,下面是我设计的结构和类,最终目标是使用boost序列化将值写入xml 当我编译下面的代码时,我得到了一个编译时错误(错误很大,我只是粘贴了最后一行,这可能会讨论这个问题) /hpp:118:错误:'class std::map,std::allocator>,std::map,std::allocator>,std::map,std::allocator>,IdInfo,std::less,std::allocator>,std::allocator>,std::allocator>,IdInf

下面是我设计的结构和类,最终目标是使用boost序列化将值写入xml 当我编译下面的代码时,我得到了一个编译时错误(错误很大,我只是粘贴了最后一行,这可能会讨论这个问题)

/hpp:118:错误:'class std::map,std::allocator>,std::map,std::allocator>,std::map,std::allocator>,IdInfo,std::less,std::allocator>,std::allocator>,std::allocator>,IdInfo>,std::less,std::allocator>,std::allocator>,std::map,std::allocator>,IdInfo,std::less,std::分配器>>,std::分配器,std::分配器>,IdInfo>>>>,std::less,std::分配器>>,std::分配器,std::分配器>,std::映射,std::分配器>,IdInfo,std::less,std::分配器>>,IdInfo>>,std::分配器,std::less,std::分配器>>,std::分配器,std::allocator>、std::map、std::allocator>、IdInfo、std::less、std::allocator>>、std::allocator>、IdInfo>>>>>>没有名为“序列化”的成员 生成:**[READER.exe]错误1

下面的AssetReaderInfo clkass实际上有一个成员序列化,但错误与此相反

我在所有类中都定义了序列化,但它无法编译 此外,我还没有指定主要的cpp代码,因为我认为这会增加混乱

你能告诉我哪里出了问题吗

struct IdInfo
{
    std::string m_milePost;
    std::string m_cellModemAlertExclusionList;

    public:
    IdInfo():m_milePost("milepost"),m_cellModemAlertExclusionList("dummyval"){};

    template<class archive>
    void serialize(archive& ar, const unsigned int version)
    {
        using boost::serialization::make_nvp;
         ar & make_nvp("values", m_milePost);
         ar & make_nvp("values", m_cellModemAlertExclusionList);
    }
};

class myReader {
 public:

    friend class boost::serialization::access;
   // Asset ID list
   typedef std::map< std::string,IdInfo > myMap;
   typedef std::map< std::string > mySet;
   struct ReaderInfo
   {
         mySet m_aSList;
         myMap m_pList;
         myMap m_eList;
         // WIU/BS type
         std::string m_Type;
         std::string m_topic;
         std::string m_lastSavedMsg;
         template <class archive>
         void serialize(archive& ar, const unsigned int version)
         {
           using boost::serialization::make_nvp;
            ar & make_nvp("values", m_topic);
            ar & make_nvp("values", m_Type);
            ar & make_nvp("values", m_eList);
            ar & make_nvp("values", m_pList);
         }

   };
    typedef std::map< std::string, ReaderInfo > GroupDataMap;
    GroupDataMap    m_GroupDataMap;

    template<class archive>
    void serialize(archive& ar, const unsigned int version)
    {
        using boost::serialization::make_nvp;
        ar & make_nvp("Group", m_GroupDataMap);
    } 
}

int main()
{
   myReader Reader;
   boost::archive::xml_oarchive xml(ofs);
   xml << boost::serialization::make_nvp("Connections", Reader);
}
struct-IdInfo
{
std::字符串m_里程标;
std::字符串m_cellModemAlertExclusionList;
公众:
IdInfo():m_milePost(“milePost”),m_cellModemAlertExclusionList(“dummyval”){};
模板
无效序列化(存档和ar,常量未签名整数版本)
{
使用boost::serialization::make_nvp;
ar&make_nvp(“价值”,m_里程碑);
ar&make_nvp(“值”,m_cellModemAlertExclusionList);
}
};
类myReader{
公众:
好友类boost::serialization::access;
//资产ID列表
typedef std::mapmyMap;
typedef std::mapmySet;
结构读取器信息
{
mySet m_aSList;
我的地图;
myMap m_eList;
//WIU/BS类型
std::字符串m_类型;
std::字符串m_主题;
std::字符串m_lastSavedMsg;
模板
无效序列化(存档和ar,常量未签名整数版本)
{
使用boost::serialization::make_nvp;
ar&make_nvp(“价值”,m_主题);
ar&make_nvp(“值”,m_类型);
ar&make_nvp(“价值”,m_eList);
ar&make_nvp(“价值”,m_pList);
}
};
typedef std::mapGroupDataMap;
GroupDataMap m_GroupDataMap;
模板
无效序列化(存档和ar,常量未签名整数版本)
{
使用boost::serialization::make_nvp;
ar&make_nvp(“集团”,m_GroupDataMap);
} 
}
int main()
{
我的读者;
boost::archive::xml\u-oarchivexml(ofs);

xml事实证明,我应该使用std::map将/boost/serialization/map.hpp包含为iam

#include/boost/serialization/map.hpp


要么删除,要么自我回答。这样,问题就不再需要关注了