apache / rocketmq-client-cpp

Apache RocketMQ cpp client
https://rocketmq.apache.org/
Apache License 2.0
370 stars 159 forks source link

pass by reference #429

Closed SRC-xiaojin closed 2 years ago

SRC-xiaojin commented 2 years ago

What is the purpose of the change

pass by reference

Brief changelog

XX

Verifying this change

XX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

ifplusor commented 2 years ago

I think passing by value and using std::move is better in setter function. https://abseil.io/tips/117

SRC-xiaojin commented 2 years ago

I think passing by value and using std::move is better in setter function. https://abseil.io/tips/117

Copy Elision is nice. Passing by const reference is simpler and safer, code style is also unified in this project