In C++, one pattern for implementing operator+ and other overloaded binary operators is the following:
Type operator+(Type lhs, Type const& rhs ) {
lhs += rhs;
return lhs;
}
Exactly how this is compiled depends on both compiler version and optimization level, but it seems not to involve an additional copy at -O2 or -O3 on recent versions of the major compilers. See https://godbolt.org/z/W7BXKk for some experimentation with this.