I push_back a temporary object into a vector like this,
vector vec;
vec.push_back(A(\"abc\"));
will the
In the general case, it cannot be done, it could potentially be done here as vector is a template and the code might be inlined, giving more information to the optimizer to do it's job and relieving some of the requirements of function calls.
In the general case, copy elision works by placing the two objects over the same location in memory and having just two names to refer to a single object. The problem in this case would be that one of the arguments must be located inside the vector (dynamically allocated, at a particular position), and the other is an argument to the function, which might be bound by the calling convention to a particular position in the stack. If that is the case, then the compiler will not be able to optimize the copy.