You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There is no way to use literals to initialize a std::unordered_map. The parentheses are not translated into braces and hence are treated as a pair of comma-separated values by C++1, ignoring the first value.
To Reproduce bar : std::unordered_map<int, std::string> = ( ( 42, "hello" ), ( 43, "world" ) );
translates to
std::unordered_map<int,std::string> bar {(42, "hello"), (43, "world")};
Describe the bug
There is no way to use literals to initialize a std::unordered_map. The parentheses are not translated into braces and hence are treated as a pair of comma-separated values by C++1, ignoring the first value.
To Reproduce
bar : std::unordered_map<int, std::string> = ( ( 42, "hello" ), ( 43, "world" ) );
translates to
std::unordered_map<int,std::string> bar {(42, "hello"), (43, "world")};
https://cpp2.godbolt.org/z/Gqh9brrdE (this includes some more cases)
The text was updated successfully, but these errors were encountered: