[Solved] C++ STL list’s Push_back takes argument pass by value?


Function signature is

void push_back (const value_type& val);

and the value passed is copied in your list. So you can consider this a “pass-by-value” (in a operational way).
In C++11 you have also

void push_back (value_type&& val);

that is a possibilities of move your value into your list.

solved C++ STL list’s Push_back takes argument pass by value?