When I construct an unordered_set using an initialize list of three or more items, my compiler (Solstudio 12.4) compiles without complaint:
unordered_set<string> sam({"a", "b", "c"});
However, if I reduce the number of items in the initializer list to exactly 2, the compiler complains
unordered_set<string> bob({"a", "b"});
Error: Overloading ambiguity between
"std::unordered_set, std::equal_to, std::allocator>::unordered_set( std::initializer_list, unsigned long, const std::hash&, const std::equal_to&, const std::allocator&)" and
"std::unordered_set, std::equal_to, std::allocator>::unordered_set( std::unordered_set, std::equal_to, std::allocator>&&)". 1 Error(s) detected.
I'm pretty sure I can cast this error away but I'm curious about why the compiler chokes for this case. Any ideas?