A parameter is declared to be call-by-value when a const reference will suffice. This parameter type is expensive to copy.
The check is only applied to parameters of types that are expensive to copy which means they are not trivially copyable or have a non-trivial copy constructor or destructor.
Consider using a const reference to the value instead.
void f(const string Value) {
// consider making Value a reference.
}
void g(ExpensiveToCopy Value) {
// consider making Value a const reference.
Value.ConstMethd();
ExpensiveToCopy Copy(Value);
}
void f(const string& Value) {
// ...
}
void g(const ExpensiveToCopy& Value) {
// ...
Value.ConstMethd();
ExpensiveToCopy Copy(Value);
}