map_indexing_suite doesn't work with std::unordered_map<std::string, std::vector<double>> for MSVC 14.2
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start in boost/python/suite/indexing/map_indexing_suite.hpp at line 155 and reproduce the build with MSVC v142 using the nested std::unordered_map example. Compare it with the std::map and string-value cases described in the report. Done means the map_indexing_suite example builds successfully with the nested unordered_map configuration.
Written by the indexing model from the issue text.
Description
This works on MSVC 14.1 (Visual Studio 17):
#define BOOST_PYTHON_STATIC_LIB
#include <boost/python.hpp>
#include <boost/python/suite/indexing/map_indexing_suite.hpp>
#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
#include <string>
#include <unordered_map>
#include <vector>
BOOST_PYTHON_MODULE(HelloBoostPython)
{
using namespace boost::python;
class_<std::vector<double>>("DoubleVector")
.def(vector_indexing_suite<std::vector<double>>())
;
class_<std::unordered_map<std::string, std::string>>("StringVecMap")
.def(map_indexing_suite<std::unordered_map<std::string, std::vector<double>>>())
;
}
But fails when building against the v142 (VS 19) Platform Toolset:
Severity Code Description Project File Line Suppression State
Error C2039 'key_comp': is not a member of 'std::unordered_map<std::string,std::vector<double,std::allocator<double>>,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::pair<const std::string,std::vector<double,std::allocator<double>>>>>' HelloBoostPython C:\Misc\boost_1_71_0\boost\python\suite\indexing\map_indexing_suite.hpp 155
Change std::unordered_map to std::map and it works.
Change std::unordered_map<std::string, std::vector<double>> to std::unordered_map<std::string, std::string>> and it works.
- Dominant language
- C++
- Stars
- 537
- Forks
- 223
- Avg merge
- 11h 22m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/python
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
BoostDetectToolset-1.90.0.cmake file not found in an include() call in boost_python-config.cmake Open
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
AuTest Bug Tests
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/trafficserver#13714 ·
-
bug build
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
facebookincubator/velox#19143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tenstorrent/tt-metal#57393 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·