Skip to content

Commit 85d4675

Browse files
committed
Fixup
1 parent d973876 commit 85d4675

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

3rdparty/yasio/yasio/wtimer_hres.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct wtimer_hres {
7777
ULONG MinimumResolution, MaximumResolution, CurrentResolution;
7878
if (NtQueryTimerResolution(&MinimumResolution, &MaximumResolution, &CurrentResolution) != 0)
7979
break;
80-
ZwSetTimerResolution(yasio::clamp(timer_res, MaximumResolution, MinimumResolution), TRUE, &timer_res);
80+
ZwSetTimerResolution(std::clamp(timer_res, MaximumResolution, MinimumResolution), TRUE, &timer_res);
8181
} while (false);
8282
# endif
8383
}

tests/unit-tests/Source/axmol/tlx/ContainerTests.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
#include "TestUtils.h"
33
#include <iostream>
44

5-
// #include <flat_set>
6-
// #include <flat_map>
5+
#if __has_include(<flat_map>)
6+
# include <flat_set>
7+
# include <flat_map>
8+
# define _AX_STL_HAS_FLAT_CONTAINER 1
9+
#else
10+
# define _AX_STL_HAS_FLAT_CONTAINER 0
11+
#endif
712

813
#include <set>
914
#include <unordered_set>
@@ -12,7 +17,7 @@
1217
#include "axmol/tlx/flat_set.hpp"
1318
#include "axmol/tlx/flat_map.hpp"
1419

15-
template<typename _Tp>
20+
template <typename _Tp>
1621
using my_flat_set = _TLX flat_set<_Tp, std::less<_Tp>, tlx::vector<_Tp>>;
1722

1823
template <typename _Cont1, typename _Cont2>
@@ -122,25 +127,27 @@ static void run_benchmark()
122127
keys[i] = dist(rng);
123128
}
124129

130+
#if _AX_STL_HAS_FLAT_CONTAINER
131+
auto s4 = benchmark_set<std::flat_set<int>>("std::flat_set", keys);
132+
auto m4 = benchmark_map<std::flat_map<int, int>>("std::flat_map", keys);
133+
#endif
125134
auto s1 = benchmark_set<std::set<int>>("std::set", keys);
126135
auto s2 = benchmark_set<std::unordered_set<int>>("std::unordered_set", keys);
127136
auto s3 = benchmark_set<tlx::hash_set<int>>("tlx::hash_set", keys);
128-
//auto s4 = benchmark_set<std::flat_set<int>>("std::flat_set", keys);
137+
129138
auto s5 = benchmark_set<tlx::flat_set<int>>("tlx::flat_set", keys);
130139
auto s6 = benchmark_set<my_flat_set<int>>("my_flat_set", keys);
131140

132141
auto m1 = benchmark_map<std::map<int, int>>("std::map", keys);
133142
auto m2 = benchmark_map<std::unordered_map<int, int>>("std::unordered_map", keys);
134143
auto m3 = benchmark_map<tlx::hash_map<int, int>>("tlx::hash_map", keys);
135-
//auto m4 = benchmark_map<std::flat_map<int, int>>("std::flat_map", keys);
136144
auto m5 = benchmark_map<tlx::flat_map<int, int>>("tlx::flat_map", keys);
137145

138146
std::sort(keys.begin(), keys.end());
139147
keys.erase(std::unique(keys.begin(), keys.end()), keys.end());
140148

141149
CHECK(vector_equals(keys, s5.keys()));
142150
CHECK(vector_equals(keys, s6.keys()));
143-
// CHECK(keys == m5.keys());
144151
}
145152

146153
TEST_SUITE("tlx/Containers")

0 commit comments

Comments
 (0)