map_indexing_suite doesn't work with std::unordered_map<std::string, std::vector<double>> for MSVC 14.2
まだ誰も着手していません。
評価
調査の方向性
boost/python/suite/indexing/map_indexing_suite.hpp の 155 行目から開始し、ネストされた std::unordered_map の例を使用して MSVC v142 でビルドを再現します。レポートに記載されている std::map のケースおよび string 値のケースと比較してください。ネストされた unordered_map 構成で map_indexing_suite の例が正常にビルドできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C++
- スター
- 537
- フォーク
- 223
- 平均マージ
- 11時間 22分
- マージ済み PR(30日)
- 2
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/python のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
BoostDetectToolset-1.90.0.cmake file not found in an include() call in boost_python-config.cmake オープン
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
boostorg/python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
objectionary/eo-graphs#74 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
QuantStack/git2cpp#187 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100