Consider the following code:
#include <iostream> #include <string> using namespace std; int main() { set<string> ssA{ { "a", "b" } }; set<string> ssB( { "a", "b" } ); for (auto s : ssA) { cout << s << endl; } for (auto s : ssB) { cout << s << endl; } return 0; }Isn't ssA expected the same as ssB ? While, it throws a run-time error, 'cos the Ctor of ssA is taken as "set<string>(_Iter _First, _Iter _Last)", which will obviously try to cast stirng to _Iter .
Is it a feature or a bug or something else?