Skip to content

Commit 8d5c9b7

Browse files
committed
Add feature test guard for <memory_resource>
1 parent 3a67af5 commit 8d5c9b7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/cpp2util.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define __CPP2_UTIL
2222

2323
// If this implementation doesn't support source_location yet, disable it
24+
// TODO: technically this test should have <version> included first, but GEFN
2425
#if !defined(_MSC_VER) && !defined(__cpp_lib_source_location)
2526
#undef CPP2_USE_SOURCE_LOCATION
2627
#endif
@@ -59,6 +60,7 @@
5960
// isn't yet supported by all of { VS 2022, g++-10, clang++-12 }
6061
// ... this should approximate "import std;" on those compilers
6162
#else
63+
#include <version>
6264
#include <concepts>
6365
#ifdef __cpp_lib_coroutine
6466
#include <coroutine>
@@ -85,9 +87,10 @@
8587
#include <typeinfo>
8688
#include <utility>
8789
#include <variant>
88-
#include <version>
8990
#include <memory>
90-
#include <memory_resource>
91+
#ifdef __cpp_lib_memory_resource
92+
#include <memory_resource>
93+
#endif
9194
#include <new>
9295
#include <scoped_allocator>
9396
#include <cfloat>

0 commit comments

Comments
 (0)