Learn to Use Constant References in C++ Functions
April 28, 2021
When we call a function with parameters taken by value, it copies the values to be made. This is a relatively inexpensive operation for fundamental types such as int, float, etc. If the parameter is composed of a large compound type, this may result in a certain overhead. For example, let’s consider this following function to combine name, mid name, and surname.
string fullname (string…