fix: [test] fatal error C1083 cannot open include file 'memory_resource'

This commit is contained in:
mutouyun 2022-11-14 21:46:17 +08:00
parent a392b88787
commit 4c9c8bb875

View File

@ -1,6 +1,8 @@
#include <vector>
#if defined(LIBIMP_CPP_17) && defined(__cpp_lib_memory_resource)
#include <memory_resource>
#endif
#include "gtest/gtest.h"
@ -11,8 +13,10 @@ TEST(allocator, detail) {
EXPECT_FALSE(pmr::detail::has_allocate<int>::value);
EXPECT_FALSE(pmr::detail::has_allocate<std::vector<int>>::value);
EXPECT_TRUE (pmr::detail::has_allocate<std::allocator<int>>::value);
#if defined(LIBIMP_CPP_17) && defined(__cpp_lib_memory_resource)
EXPECT_TRUE (pmr::detail::has_allocate<std::pmr::memory_resource>::value);
EXPECT_TRUE (pmr::detail::has_allocate<std::pmr::polymorphic_allocator<int>>::value);
#endif
}
TEST(allocator, construct) {