BewareMyPower commented on PR #66:
URL: https://github.com/apache/pulsar-client-cpp/pull/66#issuecomment-1301691454

   @tongsucn Good point. I think it's determined by how do you use that.
   
   If you only want a view of the Message's value, you can create an instance 
`std::string_view` (or a similar class). But you should be careful that the 
lifetime is the same as `Message`, i.e. you must keep the `Message` objects in 
memory to make `std::string_view` valid.
   
   If you want some extra in place operations, I think you can expose the 
non-const `data()` override.
   
   ```c++
   const void* getData() const;
   void* getData();  // new interface
   ```
   
   If your process function in application just accepts a `std::string`, I'm 
afraid you have to change it to `std::string_view`.


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

Reply via email to