The sample code is:
#include <unordered_map>
int main() {
std::unordered_map<int, std::pair<int, int>> map;
map.emplace(1, {1, 1});
return 0;
}
Where the emplace()
has signature, like:
template <class... _Args>
pair<iterator, bool> emplace(_Args&&... __args);
The gcc
says that function expectes 0 arguments - 2 provided. The clang
says that function expects 1 argument - 2 provided.
I don't even understand - what the problem is with this code?
{...}
is not an expression. The first is a special-casing forauto
-deduction which should really never have been there (and will hopefully be removed sometime in the future), and the second one is just construction from braced-init-list. – Grabowski