2 ms·
Why Would You Ever Pass a Container By Value?
- dvt 13y agoApart from some complicated features of compilers that deal with copy-constructor optimizations, passing by-value or by-reference is usually a judgment call. Some APIs like getting everything by value and others by reference. It's a kind of silly distinction that is reminiscent of a bygone era. It's still relevant if you work in embedded programming though (or if you're dealing with non-characteristically huge objects).