4 ms·
The compiler can't read your intention. Emplace means "forward these arguments to the constructor", so it forwards those arguments to the constructor (in this c
by wrsh07 2y ago
The compiler can't read your intention. Emplace means "forward these arguments to the constructor", so it forwards those arguments to the constructor (in this case, vector<int>).
With push back it would be caught by the compiler because you can't implicitly convert 2<<20 to a vector<int>