:
- , ( ) .
- Pass all other objects via the const link .
This makes it understandable for the caller with minimal documentation and zero cost performance, whose parameters are constant or not.
You can also apply this to primitive types, but it depends on whether you need to use const references for non-output parameters, since they are explicitly passed by value and cannot act as function output in any case (for direct types, not pointers / links - of course).
Tyler source
share