I've installed the latest MinGW (8.1.0) and have tested with Eclipse Neon and Photon
#include <iostream>
#include <unordered_map>
int main(){
std::unordered_map<int,std::string> dict = {{1,"one"},{2,"two"}};
dict.insert({3,"three"});
for(const auto& p: dict){std::cout << p.first << " = " << p.second << std::endl;}
}
it compiles fine, but the insert
method is underlined red.
Eclipse gives the error: 'insert' is ambiguous
is there any way to update the eclipse indexer or something?
EDIT:
casting an argument to const removes the syntax error
dict.insert(std::pair<const int,std::string>{3,"three"});
EDIT 2:
or you can use MinGW (5.1.0) with C++11 dialect
EDIT 3:
Eclipse Photon R
GCC 7.3.0
EDIT 4:
CDT 9.5.5 for Photon (19th Nov 2018)
Eclipse 4.6 (Neon 2016) is no longer supported. (CDT 9.2)
Eclipse 4.8 (Photon 2018) is no longer supported. (CDT 9.5)
Eclipse 4.9 (2019) is now on the rise, starting with CDT 9.6.