Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Differential D58879 Diff 199196 test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_values.pass.cpp
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | void test_pmr_not_uses_allocator(TT&& t, UU&& u) | ||||
using U = NotUsesAllocator<Alloc, 1>; | using U = NotUsesAllocator<Alloc, 1>; | ||||
assert((doTest<T, U>(UA_None, UA_None, | assert((doTest<T, U>(UA_None, UA_None, | ||||
std::forward<TT>(t), std::forward<UU>(u)))); | std::forward<TT>(t), std::forward<UU>(u)))); | ||||
} | } | ||||
} | } | ||||
int main(int, char**) | int main(int, char**) | ||||
{ | { | ||||
#if _LIBCPP_STD_VER <= 17 | |||||
using ERT = std::experimental::erased_type; | using ERT = std::experimental::erased_type; | ||||
using PMR = ex::memory_resource*; | using PMR = ex::memory_resource*; | ||||
#endif // _LIBCPP_STD_VER <= 17 | |||||
using PMA = ex::polymorphic_allocator<char>; | using PMA = ex::polymorphic_allocator<char>; | ||||
{ | { | ||||
int x = 42; | int x = 42; | ||||
int y = 42; | int y = 42; | ||||
#if _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<ERT>(x, std::move(y)); | test_pmr_uses_allocator<ERT>(x, std::move(y)); | ||||
test_pmr_not_uses_allocator<PMR>(x, std::move(y)); | test_pmr_not_uses_allocator<PMR>(x, std::move(y)); | ||||
#endif // _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<PMA>(x, std::move(y)); | test_pmr_uses_allocator<PMA>(x, std::move(y)); | ||||
} | } | ||||
{ | { | ||||
int x = 42; | int x = 42; | ||||
const int y = 42; | const int y = 42; | ||||
#if _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<ERT>(std::move(x), y); | test_pmr_uses_allocator<ERT>(std::move(x), y); | ||||
test_pmr_not_uses_allocator<PMR>(std::move(x), y); | test_pmr_not_uses_allocator<PMR>(std::move(x), y); | ||||
#endif // _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<PMA>(std::move(x), y); | test_pmr_uses_allocator<PMA>(std::move(x), y); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } |