1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class Alloc>
13 // struct allocator_traits
15 // template <class Ptr>
16 // static void destroy(allocator_type& a, Ptr p);
22 #include <type_traits>
25 #include "test_macros.h"
62 std::aligned_storage<sizeof(A0)>::type a0;
63 std::allocator_traits<A<int> >::construct(a, (A0*)&a0);
64 assert(A0::count == 0);
65 std::allocator_traits<A<int> >::destroy(a, (A0*)&a0);
66 assert(A0::count == 1);
68 #if TEST_STD_VER >= 11
73 std::aligned_storage<sizeof(A0)>::type a0;
74 std::allocator_traits<B<int> >::construct(b, (A0*)&a0);
75 assert(A0::count == 0);
76 assert(b_destroy == 0);
77 std::allocator_traits<B<int> >::destroy(b, (A0*)&a0);
78 assert(A0::count == 1);
79 assert(b_destroy == 1);