boost - 无法使用 boost::bimap 编译
问题描述
我很难把它变成boost::bimap
. 它不会编译:
我改变:
using MapStudentItemDesc = std::map<UINT, CString>;
至
using MapStudentItemDesc = boost::bimap<UINT, CString>;
然后我像这样声明地图:
MapStudentItemDesc mapStudentItemDescBefore;
我填写它,例如:
rMapStudentItems.insert({IDS_CMB_METHOD_BIBLE_READING, SMMETHOD3(eLanguage, IDS_CMB_METHOD_BIBLE_READING)});
我希望能够轻松地查找右侧的值,从而获得左侧的关联键。
我得到如下编译错误:
D:\My Libraries\Boost\boost_1_71_0\boost\bimap\detail\bimap_core.hpp(408,1): error C4996: 'std::allocator<void>::rebind<boost::bimaps::relation::mutant_relation<boost::bimaps::tags::tagged<const unsigned int,boost::bimaps::relation::member_at::left>,boost::bimaps::tags::tagged<const ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t>>>,boost::bimaps::relation::member_at::right>,boost::bimaps::detail::manage_additional_parameters<AP1,AP2,AP3>::case_NNN::additional_info,true>>': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
5> with
5> [
5> AP1=boost::mpl::na,
5> AP2=boost::mpl::na,
5> AP3=boost::mpl::na
5> ]
5>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xmemory(852,1): message : see declaration of 'std::allocator<void>::rebind'
5>D:\My Libraries\Boost\boost_1_71_0\boost\bimap\bimap.hpp(134): message : see reference to class template instantiation 'boost::bimaps::detail::bimap_core<KeyTypeA,KeyTypeB,AP1,AP2,AP3>' being compiled
5> with
5> [
5> KeyTypeA=UINT,
5> KeyTypeB=CString,
5> AP1=boost::mpl::na,
5> AP2=boost::mpl::na,
5> AP3=boost::mpl::na
5> ]
5>D:\My Programs\2019\MeetSchedAssist\Meeting Schedule Assistant\ChristianLifeMinistryEditorDlg.cpp(7300): message : see reference to class template instantiation 'boost::bimaps::bimap<UINT,CString,boost::mpl::na,boost::mpl::na,boost::mpl::na>' being compiled
5>D:\My Libraries\Boost\boost_1_71_0\boost\bimap\detail\bimap_core.hpp(407,9): error C4996: 'std::allocator<void>::rebind<boost::bimaps::relation::mutant_relation<boost::bimaps::tags::tagged<const unsigned int,boost::bimaps::relation::member_at::left>,boost::bimaps::tags::tagged<const ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t>>>,boost::bimaps::relation::member_at::right>,boost::bimaps::detail::manage_additional_parameters<AP1,AP2,AP3>::case_NNN::additional_info,true>>::other': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
5> with
5> [
5> AP1=boost::mpl::na,
5> AP2=boost::mpl::na,
5> AP3=boost::mpl::na
5> ]
5>ChristianLifeMinistryEditorSettingsDlg.cpp
解决方案
推荐阅读
- c# - 无法登录到应用程序 - 发生与网络相关或特定于实例的错误
- angular - 无法通过直接路径访问 S3 托管网站
- react-native - 如何在 react native expo 中使用 3rd 方库
- swift - 我在控制台中得到的这个 [__lldb_expr_19.Book] 是什么?
- html - 旋转元素时,它放置在固定元素上
- javascript - 用户使用 JavaScript 和 HTML 输入的从 1 到 A 的数字加起来
- javascript - 在反应钩子中将状态数组的数据导出到 csv 文件
- benchmarkdotnet - 在哪里可以找到 benchmarkdotnet 输出的文档
- python-3.x - 使用 wget 下载 .xlsx 文件时出现奇怪的错误
- python - 如何用 pandas 构造向量化函数?