1 // { dg-options "-std=gnu++11" }
3 // Copyright (C) 2011-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 // NB: This file is for testing scoped_allocator with NO OTHER INCLUDES.
23 #include <scoped_allocator>
28 struct minimal_allocator
33 minimal_allocator(const minimal_allocator
<U
>&);
34 T
* allocate(unsigned long);
35 void deallocate(T
*, unsigned long);
40 typedef minimal_allocator
<short> allocator_type
;
41 S(const allocator_type
&);
46 typedef minimal_allocator
<S
> outer_type
;
47 typedef minimal_allocator
<S::allocator_type
> inner_type
;
48 typedef std::scoped_allocator_adaptor
<outer_type
, inner_type
> test_type
;
50 // Check for required typedefs
51 typedef typename
test_type::outer_allocator_type outer_allocator_type
;
52 typedef typename
test_type::inner_allocator_type inner_allocator_type
;
53 typedef typename
test_type::value_type value_type
;
54 typedef typename
test_type::size_type size_type
;
55 typedef typename
test_type::difference_type difference_type
;
56 typedef typename
test_type::pointer pointer
;
57 typedef typename
test_type::const_pointer const_pointer
;
58 typedef typename
test_type::void_pointer void_pointer
;
59 typedef typename
test_type::const_void_pointer const_void_pointer
;
60 typedef typename
test_type::propagate_on_container_copy_assignment
61 propagate_on_container_copy_assignment
;
62 typedef typename
test_type::propagate_on_container_move_assignment
63 propagate_on_container_move_assignment
;
64 typedef typename
test_type::propagate_on_container_swap
65 propagate_on_container_swap
;