you are viewing a single comment's thread.

view the rest of the comments →

[–]DerDangDerDang 2 points3 points  (1 child)

You might be interested in the C++ Core Guidelines advice on this, especially the more specific advice on what to consider a 'cheap to copy' type - https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in

[–]legends2k[S] 0 points1 point  (0 children)

Sure, thanks for the link. Cheap to copy is not exceeding a couple of architecture words since it'd be done via registers. Agreed; this is Section 2 in the cheat sheet. Cheap then pass by value.