0

ウォッチ ウィンドウで特定の std::map を表示できません。.natvis ファイルを調べると、std::map の複数の実装があります。どちらかを選択する方法はありますか?

https://developercommunity.visualstudio.com/content/problem/1056550/im-unable-to-inspect-a-variable-of-type-stdmap-in.html

#include <iostream>
#include <map>
#include <string>
#include <vector>
#include <set>
#include <memory>

typedef std::shared_ptr<std::string> PTR_STRING;
typedef std::map<PTR_STRING, std::size_t> accessFunction2Order;
typedef std::set<accessFunction2Order> setOfAccessFunction2Order;
typedef std::map<std::vector<std::size_t>, setOfAccessFunction2Order> A2B;
typedef std::map<PTR_STRING, std::shared_ptr<A2B> > MAP;

int main()
{   MAP s{
        {    std::make_shared<std::string>("asdasdasdasdasdasdasdasdasdasd"),
            std::make_shared<A2B>()
        }
    };
    const auto &r1 = *s.begin();
}

map は監視できません ( std::_Tree<> に関する何かが表示されています)。不思議なことに、最初の要素への参照ができます。

4

1 に答える 1