blob: 4abc69f0b3d178e29824cfa089fd8fe8e7edb347 [file] [log] [blame]
Eric Fiselier257fd692016-05-07 01:04:55 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// UNSUPPORTED: c++98, c++03
11
12// <experimental/memory_resource>
13
14// template <class Alloc> class resource_adaptor_imp;
15
16// resource_adaptor_imp<Alloc>::resource_adaptor_imp() = default;
17
18#include <experimental/memory_resource>
19#include <memory>
20#include <type_traits>
21#include <cassert>
22
23#include "test_memory_resource.hpp"
24
25namespace ex = std::experimental::pmr;
26
27int main()
28{
29 {
30 typedef CountingAllocator<char> AllocT; // Not default constructible
31 typedef ex::resource_adaptor<AllocT> R;
32 static_assert(!std::is_default_constructible<R>::value, "");
33 }
34 {
35 typedef std::allocator<char> AllocT; // Is default constructible
36 typedef ex::resource_adaptor<AllocT> R;
37 static_assert(std::is_default_constructible<R>::value, "");
38 R r; ((void)r);
39 }
40}