Skip to content

Commit 4fc2b18

Browse files
committed
Fixed win build, attempt #3
1 parent 8638aa3 commit 4fc2b18

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ut/utils.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <ratio>
99
#include <system_error>
1010
#include <vector>
11+
#include <type_traits>
1112

1213
#include <time.h>
1314

@@ -71,22 +72,19 @@ inline ostream & operator<<(ostream & ostr, const chrono::duration<R, P> & d) {
7172
}
7273
}
7374

74-
#ifdef _win_
75-
#define _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING 1
76-
#endif
77-
// Since result_of is deprecated in C++20, and invoke_result_of is unavailable until C++20...
75+
// Since result_of is deprecated in C++17, and invoke_result_of is unavailable until C++20...
7876
template <class F, class... ArgTypes>
7977
using my_result_of_t =
80-
#if __cplusplus >= 202002L
81-
std::invoke_result_of_t<F, ArgTypes...>;
78+
#if __cplusplus >= 201703L
79+
std::invoke_result_t<F, ArgTypes...>;
8280
#else
83-
std::result_of_t<F>;
81+
std::result_of_t<F()>;
8482
#endif
8583

8684
template <typename MeasureFunc>
8785
class MeasuresCollector {
8886
public:
89-
using Result = my_result_of_t<MeasureFunc()>;
87+
using Result = my_result_of_t<MeasureFunc>;
9088

9189
explicit MeasuresCollector(MeasureFunc && measurment_func, const size_t preallocate_results = 10)
9290
: measurment_func_(std::move(measurment_func))

0 commit comments

Comments
 (0)