Skip to content

Commit

Permalink
Make ServerStreamMultiPublisher build with older toolchains
Browse files Browse the repository at this point in the history
Summary: Certain toolchains cannot handle `std::weak_ptr(...)` without an explicit template parameter.

Reviewed By: yfeldblum

Differential Revision: D33978300

fbshipit-source-id: 3dd21f6d55e81c7d4eda1c41ccca5eb80e158d9c
  • Loading branch information
Zoltán Gilián authored and facebook-github-bot committed Feb 7, 2022
1 parent 8656169 commit c841acf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thrift/lib/cpp2/async/ServerStreamMultiPublisher.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class ServerStreamMultiPublisher {
auto cb = [streamIndex,
userCb = std::move(onStreamCompleteOrCancel),
encodeToStreamsWeak =
std::weak_ptr(encodeToStreams_)]() mutable {
folly::to_weak_ptr(encodeToStreams_)]() mutable {
removeStream(std::move(encodeToStreamsWeak), streamIndex);
userCb();
};
Expand All @@ -123,7 +123,7 @@ class ServerStreamMultiPublisher {
addStreamToMap(streamIndex, stream->copy());
return ServerStream<T>(
[streamIndex,
encodeToStreamsWeak = std::weak_ptr(encodeToStreams_),
encodeToStreamsWeak = folly::to_weak_ptr(encodeToStreams_),
stream = std::unique_ptr<
detail::ServerPublisherStream<T, WithHeader>,
typename detail::ServerPublisherStream<T, WithHeader>::
Expand Down

0 comments on commit c841acf

Please sign in to comment.