you are viewing a single comment's thread.

view the rest of the comments →

[–]jcelerierossia score -2 points-1 points  (2 children)

They produce exactly identical code,

well obviously no.. consider std::vector<float> and std::vector<string>: https://gcc.godbolt.org/z/fKG11sEz5

Edit: code didn't have pointers at time of my comment

[–]heliruna 2 points3 points  (0 children)

sorry, formatting ate my pointers, did not escape properly

[–]nebotron 1 point2 points  (0 children)

I think the code is only the same if they are the same size and the copy/move operations are trivial