I am having trouble turning this into a boost::bimap
. It won't compile:
I change:
using MapStudentItemDesc = std::map<UINT, CString>;
to
using MapStudentItemDesc = boost::bimap<UINT, CString>;
And then I declared the map like this:
MapStudentItemDesc mapStudentItemDescBefore;
And I fill it, for example:
rMapStudentItems.insert({IDS_CMB_METHOD_BIBLE_READING, SMMETHOD3(eLanguage, IDS_CMB_METHOD_BIBLE_READING)});
I wanted to be able to easily lookup a value on the right, and thus obtain the associated key on the left.
I get compile errors liek this:
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