librdkafka
librdkafka copied to clipboard
rdkafkacpp: Eliminate "return by const value" pessimizations.
Returning a const string means "My caller can have a copy of
this string, but they aren't allowed to modify it" -- for example,
they aren't allowed to use move semantics to move-out-of the
returned string. Thus x = y.name(); will use copy assignment
rather than move assignment. This is a needless pessimization
in C++11 and later.
See also the errata marked "nxd" in https://www.aristeia.com/BookErrata/ec++3e-errata.html