BewareMyPower commented on code in PR #98:
URL: https://github.com/apache/pulsar-client-cpp/pull/98#discussion_r1012507431
##########
lib/OpSendMsg.h:
##########
@@ -59,6 +60,13 @@ struct OpSendMsg {
if (sendCallback_) {
sendCallback_(result, messageId);
}
+ for (const auto& trackerCallback : trackerCallbacks_) {
+ trackerCallback(result);
+ }
+ }
+
+ void addTrackerCallback(std::function<void(Result)> trackerCallback) {
Review Comment:
It's common to pass the `std::function` by value. Regarding the value
argument, adding `const` does not harm but it also does not bring any benefit.
Take https://en.cppreference.com/w/cpp/string/basic_string/basic_string for
example, the constructors that accept integral types don't add `const`
qualifiers.
```c++
basic_string( size_type count, CharT ch,
const Allocator& alloc = Allocator() );
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]