Skip to content

Commit 9c8701d

Browse files
authored
Fixes deprecation warning (#1530)
std::result_of is deprecated and generates noisy warnings when C++17 is enabled. Relates-To: IOTSDK-18534 Signed-off-by: Yauheni Khnykin <yauheni.khnykin@here.com>
1 parent d8e6b98 commit 9c8701d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

olp-cpp-sdk-core/include/olp/core/client/TaskContext.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,14 @@ class CORE_API TaskContext {
109109
TaskContext() = default;
110110

111111
template <typename Exec, typename Callback,
112-
typename ExecResult = typename std::result_of<
113-
Exec(client::CancellationContext)>::type>
112+
#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
113+
typename ExecResult =
114+
std::invoke_result_t<Exec, client::CancellationContext>
115+
#else
116+
typename ExecResult =
117+
typename std::result_of<Exec(client::CancellationContext)>::type
118+
#endif
119+
>
114120
/**
115121
* @brief Sets the executors for the request.
116122
*

0 commit comments

Comments
 (0)