Because in C#, the operation is "cheap" -- it's just returning a byte-for-byte copy of the struct or object reference.
In C++, returning the object is expensive -- it requires making a copy of the object itself by calling the copy constructor, which can involve practically anything the user has specified must happen, including (but not limited to) allocating new resources and destroying old ones.
(For example, imagine if the object to be returned was a binary tree. Copying it would be very expensive compared to copying, say, an int
.)
C++11 could have used "move semantics" to avoid copying objects, but move semantics were introduced after pop_back
was, and they didn't bother changing it.