Copilot commented on code in PR #3701:
URL: https://github.com/apache/brpc/pull/3701#discussion_r4445075130


##########
src/butil/iobuf_inl.h:
##########
@@ -492,16 +492,15 @@ struct IOBuf::Block {
         }
     }
 
-    Block(char* data_in, uint32_t data_size, UserDataDeleter deleter)
+    Block(char* data_in, uint32_t data_size, UserDataDeleter&& deleter)

Review Comment:
   This changes the publicly defined `IOBuf::Block` constructor from accepting 
a `UserDataDeleter` by value to accepting only an rvalue reference. Since 
`iobuf.h` includes this definition and `Block` is publicly declared, existing 
callers that pass a named `std::function<void(void*)>` now fail to compile, so 
this is a source-compatible API break despite the PR description saying there 
is none. Keep an lvalue-compatible overload that copies into the rvalue 
overload, while retaining this overload for the optimized rvalue path.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to