Add missing "#include <algorithm>" for std::find_if#669
Closed
kou wants to merge 1 commit into
Closed
Conversation
`thrift/lib/cpp2/server/DecoratorDataRuntime.h` uses `std::find_if`
but `algorithm` isn't included.
This causes the following error with g++ 14.3.0:
FAILED: thrift/lib/cpp2/CMakeFiles/thriftcpp2.dir/server/DecoratorDataRuntime.cpp.o ...
In file included from thrift/lib/cpp2/server/DecoratorDataRuntime.cpp:17:
thrift/lib/cpp2/server/DecoratorDataRuntime.h: In member function 'apache::thrift::server::DecoratorDataHandle<T> apache::thrift::server::DecoratorDataHandleFactory::makeHandleForKey(const apache::thrift::server::DecoratorDataKey<T>&)':
thrift/lib/cpp2/server/DecoratorDataRuntime.h:32:24: error: 'find_if' is not a member of 'std'; did you mean 'find'?
32 | if (auto it = std::find_if(
| ^~~~~~~
| find
Contributor
facebook-github-bot
pushed a commit
to facebook/hhvm
that referenced
this pull request
Sep 2, 2025
Summary:
`thrift/lib/cpp2/server/DecoratorDataRuntime.h` uses `std::find_if` but `algorithm` isn't included.
This causes the following error with g++ 14.3.0:
FAILED: thrift/lib/cpp2/CMakeFiles/thriftcpp2.dir/server/DecoratorDataRuntime.cpp.o ...
In file included from thrift/lib/cpp2/server/DecoratorDataRuntime.cpp:17:
thrift/lib/cpp2/server/DecoratorDataRuntime.h: In member function 'apache::thrift::server::DecoratorDataHandle<T> apache::thrift::server::DecoratorDataHandleFactory::makeHandleForKey(const apache::thrift::server::DecoratorDataKey<T>&)':
thrift/lib/cpp2/server/DecoratorDataRuntime.h:32:24: error: 'find_if' is not a member of 'std'; did you mean 'find'?
32 | if (auto it = std::find_if(
| ^~~~~~~
| find
X-link: facebook/fbthrift#669
Reviewed By: sadroeck
Differential Revision: D81513836
Pulled By: iahs
fbshipit-source-id: acf3b1d2a09660fd5fa78fe6f6cea5329acc09ed
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
thrift/lib/cpp2/server/DecoratorDataRuntime.husesstd::find_ifbutalgorithmisn't included.This causes the following error with g++ 14.3.0: