I get this error when compiling this code:
#include <map>
#include <set>
#include <iostream>
int main() {
using std::set;
using std::map;
set<int> s;
s.insert(4);
s.insert(3);
map<set<int>, int> myMap;
myMap.insert(make_pair(s, 8));
for (map<set<int>, int>::iterator it = myMap.begin(); it != myMap.end();
it++) {
std::cout << it->first << "->" << it->second << std::endl;
}
return 0;
}
The error is indicated on the line //HERE
:
error: cannot bind std::ostream
{aka std:: basic_ostream <char>
} lvalue tostd::basic_ostream<char>&&
source
share