2

次のコードを用意しましょう

#include <map>
template <typename Value>
static void Get(std::map<int, Value> & map)
{
    typename std::map<int, Value>::const_iterator it;
    it _it = map.find(1);
}
void main()
{
    std::map<int,std::string> _map;
    _map.insert(std::pair<int,std::string>(1, "1"));
    Get<std::string>(_map);
}

行のエラーが発生します

it _it = map.find(1);

なんでそうなの?

4

1 に答える 1