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 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: c++03
10
11 // test_memory_resource requires RTTI for dynamic_cast
12 // UNSUPPORTED: no-rtti
13
14 // <experimental/memory_resource>
15
16 // template <class Alloc> class resource_adaptor_imp;
17
18 #include <experimental/memory_resource>
19 #include <type_traits>
20 #include <memory>
21 #include <cassert>
22
23 #include "test_macros.h"
24
25 namespace ex = std::experimental::pmr;
26
main(int,char **)27 int main(int, char**)
28 {
29 typedef ex::resource_adaptor<std::allocator<int>> R;
30 typedef ex::resource_adaptor<std::allocator<long>> R2;
31 static_assert(std::is_same<R, R2>::value, "");
32 {
33 static_assert(std::is_base_of<ex::memory_resource, R>::value, "");
34 static_assert(std::is_same<R::allocator_type, std::allocator<char>>::value, "");
35 }
36 {
37 static_assert(std::is_default_constructible<R>::value, "");
38 static_assert(std::is_copy_constructible<R>::value, "");
39 static_assert(std::is_move_constructible<R>::value, "");
40 static_assert(std::is_copy_assignable<R>::value, "");
41 static_assert(std::is_move_assignable<R>::value, "");
42 }
43
44 return 0;
45 }
46