Skip to content

Commit

Permalink
Add std::unique_ptr<folly::IOBuf> overload for op::serialiedSize
Browse files Browse the repository at this point in the history
Summary: TSIA

Reviewed By: SuperBald

Differential Revision: D67311336

fbshipit-source-id: e4c405f9d58d4516e646e541978f7da0714a9b63
  • Loading branch information
thedavekwon authored and facebook-github-bot committed Dec 17, 2024
1 parent f3b79cf commit e48afd0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions third-party/thrift/src/thrift/lib/cpp2/op/detail/Encode.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ struct SerializedSize<false, type::binary_t> {
uint32_t operator()(Protocol& prot, const folly::IOBuf& s) const {
return prot.serializedSizeBinary(s);
}

template <typename Protocol>
uint32_t operator()(
Protocol& prot, const std::unique_ptr<folly::IOBuf>& s) const {
return prot.serializedSizeBinary(s);
}
};

template <>
Expand All @@ -236,6 +242,11 @@ struct SerializedSize<true, type::binary_t> {
uint32_t operator()(Protocol& prot, const folly::IOBuf& s) const {
return prot.serializedSizeZCBinary(s);
}
template <typename Protocol>
uint32_t operator()(
Protocol& prot, const std::unique_ptr<folly::IOBuf>& s) const {
return prot.serializedSizeZCBinary(s);
}
};

template <typename T>
Expand Down

0 comments on commit e48afd0

Please sign in to comment.