#include <map>
#include <vector>
#include <iostream>
int main() {
std::map<int *, std::vector<double>> m;
const auto &cm = m;
std::cout << cm[nullptr].size();
}
I2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKSB7CgkKCXN0ZDo6bWFwPGludCAqLCBzdGQ6OnZlY3Rvcjxkb3VibGU+PiBtOwoJY29uc3QgYXV0byAmY20gPSBtOwoJc3RkOjpjb3V0IDw8IGNtW251bGxwdHJdLnNpemUoKTsKfQ==
prog.cpp: In function 'int main()':
prog.cpp:9:25: error: passing 'const std::map<int*, std::vector<double> >' as 'this' argument discards qualifiers [-fpermissive]
std::cout << cm[nullptr].size();
^
In file included from /usr/include/c++/5/map:61:0,
from prog.cpp:1:
/usr/include/c++/5/bits/stl_map.h:494:7: note: in call to 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](std::map<_Key, _Tp, _Compare, _Alloc>::key_type&&) [with _Key = int*; _Tp = std::vector<double>; _Compare = std::less<int*>; _Alloc = std::allocator<std::pair<int* const, std::vector<double> > >; std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type = std::vector<double>; std::map<_Key, _Tp, _Compare, _Alloc>::key_type = int*]'
operator[](key_type&& __k)
^