grpc::Slice drops a reference to the underlying grpc_slice at destruction time; if you use that in combination with the StealRef second argument, I think that you would have what you essentially want. (FWIW, the constructor for grpc::Slice that takes a grpc_slice is not really recommended since grpc_slice itself is core API which changes a lot more rapidly than C++ API).
grpc::ByteBuffer uses grpc_byte_buffer in its implementation but does not have a constructor that takes in a grpc_byte_buffer. There is an issue filed to improve the characteristics of grpc::ByteBuffer but no consideration of adding a constructor that pulls from a grpc_byte_buffer (again, since C++ API should avoid requiring the use of core API features). On Friday, October 27, 2017 at 1:38:27 PM UTC-7, Christopher Warrington - MSFT wrote: > > Are there any C++ RAII wrappers for > grpc_byte_buffer/grpc_slice/grpc_byte_buffer_reader & friends? I couldn't > find any in a cursory look. > I only really interact with these types in my specialization of > grpc::SerializationTraits. The rest of the time I'm well insulated from > them. > > -- > Christopher Warrington > Microsoft > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/776aed0c-a948-4f12-9447-61337ec77382%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
