1 // { dg-do compile { target c++11 } }
3 // Copyright (C) 2013-2016 Free Software Foundation, Inc.
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
21 #include <testsuite_allocator.h>
28 ptr(ptr
<U
> const& p
) { }
31 // This doesn't meet the allocator requirements, it's only to check
32 // that allocator_traits finds the right nested types.
38 typedef ptr
<T
> pointer
;
39 typedef ptr
<const T
> const_pointer
;
40 typedef ptr
<void> void_pointer
;
41 typedef ptr
<const void> const_void_pointer
;
42 typedef int difference_type
;
43 typedef int size_type
;
45 typedef std::false_type propagate_on_container_copy_assignment
;
46 typedef std::false_type propagate_on_container_move_assignment
;
47 typedef std::false_type propagate_on_container_swap
;
50 typedef alloc
<int> alloc_type
;
51 typedef std::allocator_traits
<alloc_type
> traits
;
55 static_assert( is_same
<traits::pointer
, alloc_type::pointer
>::value
,
58 static_assert( is_same
<traits::const_pointer
,
59 alloc_type::const_pointer
>::value
,
62 static_assert( is_same
<traits::void_pointer
, alloc_type::void_pointer
>::value
,
65 static_assert( is_same
<traits::const_void_pointer
,
66 alloc_type::const_void_pointer
>::value
,
67 "const_void_pointer");
69 static_assert( is_same
<traits::difference_type
,
70 alloc_type::difference_type
>::value
,
73 static_assert( is_same
<traits::size_type
, alloc_type::size_type
>::value
,
76 static_assert( is_same
<traits::size_type
, alloc_type::size_type
>::value
,
79 static_assert( is_same
<traits::propagate_on_container_copy_assignment
,
80 alloc_type::propagate_on_container_copy_assignment
82 "propagate_on_container_copy_assignment" );
84 static_assert( is_same
<traits::propagate_on_container_move_assignment
,
85 alloc_type::propagate_on_container_move_assignment
87 "propagate_on_container_move_assignment" );
89 static_assert( is_same
<traits::propagate_on_container_swap
,
90 alloc_type::propagate_on_container_swap
>::value
,
91 "propagate_on_container_swap" );