[OpenACC] Implement 'device_type' for 'data' construct
[llvm-project.git] / libcxx / test / std / utilities / utility / mem.res / mem.res.aliases / header_set_synop.pass.cpp
blob99ded7c35b7ad3ae491d1c00360fe6d8ba641c46
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
10 // TODO: Change to XFAIL once https://github.com/llvm/llvm-project/issues/40340 is fixed
11 // UNSUPPORTED: availability-pmr-missing
13 // <set>
15 // namespace std::pmr {
16 // template <class V, class Compare = less<V> >
17 // using set =
18 // ::std::set<V, Compare, polymorphic_allocator<V>>
20 // template <class V, class Compare = less<V> >
21 // using multiset =
22 // ::std::multiset<V, Compare, polymorphic_allocator<V>>
24 // } // namespace std::pmr
26 #include <set>
27 #include <memory_resource>
28 #include <type_traits>
29 #include <cassert>
31 int main(int, char**) {
32 using V = char;
33 using DC = std::less<V>;
34 using OC = std::greater<V>;
36 using StdSet = std::set<V, DC, std::pmr::polymorphic_allocator<V>>;
37 using PmrSet = std::pmr::set<V>;
38 static_assert(std::is_same<StdSet, PmrSet>::value, "");
41 using StdSet = std::set<V, OC, std::pmr::polymorphic_allocator<V>>;
42 using PmrSet = std::pmr::set<V, OC>;
43 static_assert(std::is_same<StdSet, PmrSet>::value, "");
46 std::pmr::set<int> m;
47 assert(m.get_allocator().resource() == std::pmr::get_default_resource());
50 using StdSet = std::multiset<V, DC, std::pmr::polymorphic_allocator<V>>;
51 using PmrSet = std::pmr::multiset<V>;
52 static_assert(std::is_same<StdSet, PmrSet>::value, "");
55 using StdSet = std::multiset<V, OC, std::pmr::polymorphic_allocator<V>>;
56 using PmrSet = std::pmr::multiset<V, OC>;
57 static_assert(std::is_same<StdSet, PmrSet>::value, "");
60 std::pmr::multiset<int> m;
61 assert(m.get_allocator().resource() == std::pmr::get_default_resource());
64 return 0;