Prior to C++11 the following code created a temporary string object and passed it to push_back, which then copied it into the vector: vector<string> myVector;
MyVector.push_back("message") ;
As of C++11, member function push_back is now overloaded with a version that takes a(n) ________. This allows the preceding call to push_back to take the storage allocated for the temporary string and reuse it directly for the new element in the vector. The temporary string will be destroyed when the function returns, so there's no need for it to keep its content.
A) const pointer
B) rvalue reference
C) rvalue pointer
D) const reference
Correct Answer:
Verified
Q25: In C++11, in a class called Employee
Q26: In general, move constructors and move assignment
Q27: An rvalue reference is declared as _
Q28: Tuples that contain the same number of
Q29: An rvalue reference is used to implement
Q31: A common example of a variadic template
Q32: A tuple's _ uses the assignment operator
Q33: The _ allows you to test constant
Q34: A _ template accepts any number of
Q35: If the initializer for a const variable
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents