Skip to content

Add missing "#include <algorithm>" for std::find_if#669

Closed
kou wants to merge 1 commit into
facebook:mainfrom
kou:decorator-data-runtime-algorithm
Closed

Add missing "#include <algorithm>" for std::find_if#669
kou wants to merge 1 commit into
facebook:mainfrom
kou:decorator-data-runtime-algorithm

Conversation

@kou

@kou kou commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

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
`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
@meta-cla meta-cla Bot added the CLA Signed label Sep 1, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@iahs has imported this pull request. If you are a Meta employee, you can view this in D81513836.

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
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@iahs merged this pull request in eedd757.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants