mardi 26 décembre 2017

Is this a bug of VC 2017?

#include <map>
#include <set>
using namespace std;
map <string, set<pair<int, set<int>>>> dictonary;

int s()
{
    for (auto & i : dictonary["abc"])
    {
        i.second.insert(2);  //error C2663
    }
}

C2663: 'std::_Tree>::insert': 5 overloads have no legal conversion for 'this' pointer.

i.second is considered by the compiler const qualified so that insertion is forbidden.

if it is not a bug, how can I manipulate it?

Aucun commentaire:

Enregistrer un commentaire