3 ms·
Apart from some complicated features of compilers that deal with copy-constructor optimizations, passing by-value or by-reference is usually a judgment call. S
by dvt 13y ago
Apart 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).