Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What does the emplace_back member function do that push_back does not?

  1. A Constructs the element in place from its arguments, avoiding a temporary
  2. B Appends multiple elements
  3. C Sorts after insertion
  4. D Reserves capacity
Answer

Constructs the element in place from its arguments, avoiding a temporary

emplace_back forwards its arguments to the element's constructor, which avoids constructing and then moving or copying a temporary.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as