Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated std::result_of #1008

Open
BenWibking opened this issue Feb 22, 2024 · 2 comments
Open

remove deprecated std::result_of #1008

BenWibking opened this issue Feb 22, 2024 · 2 comments
Assignees
Labels
C++17 enhancement New feature or request

Comments

@BenWibking
Copy link
Collaborator

src/tasks/tasks.hpp uses std::result_of, which is deprecated in C++17 and removed in C++20. This causes lots of warnings on my machine:

In file included from /Users/benwibking/athenapk/external/parthenon/src/tasks/tasks.hpp:30:
/Users/benwibking/athenapk/external/parthenon/src/tasks/thread_pool.hpp:121:36: warning: 'result_of<(lambda at /Users/benwibking/athenapk/external/parthenon/src/tasks/tasks.hpp:420:20) ()>' is deprecated [-Wdeprecated-declarations]
    using return_t = typename std::result_of<F(Args...)>::type;
                                   ^
/Users/benwibking/athenapk/external/parthenon/src/tasks/tasks.hpp:420:12: note: in instantiation of function template specialization 'parthenon::ThreadPool::enqueue<(lambda at /Users/benwibking/athenapk/external/parthenon/src/tasks/tasks.hpp:420:20)>' requested here
      pool.enqueue([t, &ProcessTask]() { return ProcessTask(t); });
           ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__type_traits/result_of.h:24:34: note: 'result_of<(lambda at /Users/benwibking/athenapk/external/parthenon/src/tasks/tasks.hpp:420:20) ()>' has been explicitly marked deprecated here
template <class _Callable> class _LIBCPP_DEPRECATED_IN_CXX17 result_of;
                                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__config:862:41: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#    define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/c++/v1/__config:835:49: note: expanded from macro '_LIBCPP_DEPRECATED'
#      define _LIBCPP_DEPRECATED __attribute__((deprecated))
                                                ^
4 warnings generated.
@BenWibking BenWibking added enhancement New feature or request C++17 labels Feb 22, 2024
@Yurlungur
Copy link
Collaborator

Ping @jdolence

@pbrady
Copy link
Collaborator

pbrady commented Apr 12, 2024

Unless I'm misunderstanding something, this is a straightforward change to std::invoke_result_t. Is this more about dropping c++14?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++17 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants