boostorg / boostorg/python

map_indexing_suite doesn't work with std::unordered_map<std::string, std::vector<double>> for MSVC 14.2

未關閉
#289 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
C++
星號
537
分支
223
平均合併
11 小時 22 分鐘
30 天內合併 PR
2

描述

This works on MSVC 14.1 (Visual Studio 17):

#define BOOST_PYTHON_STATIC_LIB

#include
#include
#include
#include
#include
#include

BOOST_PYTHON_MODULE(HelloBoostPython)
{
using namespace boost::python;

class_>("DoubleVector")
.def(vector_indexing_suite>())
;

class_>("StringVecMap")
.def(map_indexing_suite>>())
;
}

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::hash,std::equal_to,std::allocator>>>>' 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>` to `std::unordered_map>` and it works.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。