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_rvalue.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
test/std/experimental/memory/memory.polymorphic.allocator.class/memory.polymorphic.allocator.mem/construct_pair_rvalue.pass.cpp
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | void test_pmr_not_uses_allocator(std::pair<TT, UU>&& p) | ||||
using T = UsesAllocatorV3<Alloc, 1>; | using T = UsesAllocatorV3<Alloc, 1>; | ||||
using U = NotUsesAllocator<Alloc, 1>; | using U = NotUsesAllocator<Alloc, 1>; | ||||
assert((doTest<T, U>(UA_None, UA_None, std::move(p)))); | assert((doTest<T, U>(UA_None, UA_None, std::move(p)))); | ||||
} | } | ||||
} | } | ||||
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; | ||||
std::pair<int&, int&&> p(x, std::move(y)); | std::pair<int&, int&&> p(x, std::move(y)); | ||||
#if _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<ERT>(std::move(p)); | test_pmr_uses_allocator<ERT>(std::move(p)); | ||||
test_pmr_not_uses_allocator<PMR>(std::move(p)); | test_pmr_not_uses_allocator<PMR>(std::move(p)); | ||||
#endif // _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<PMA>(std::move(p)); | test_pmr_uses_allocator<PMA>(std::move(p)); | ||||
} | } | ||||
{ | { | ||||
int x = 42; | int x = 42; | ||||
int y = 42; | int y = 42; | ||||
std::pair<int&&, int&> p(std::move(x), y); | std::pair<int&&, int&> p(std::move(x), y); | ||||
#if _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<ERT>(std::move(p)); | test_pmr_uses_allocator<ERT>(std::move(p)); | ||||
test_pmr_not_uses_allocator<PMR>(std::move(p)); | test_pmr_not_uses_allocator<PMR>(std::move(p)); | ||||
#endif // _LIBCPP_STD_VER <= 17 | |||||
test_pmr_uses_allocator<PMA>(std::move(p)); | test_pmr_uses_allocator<PMA>(std::move(p)); | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } |