131
|
1 // { dg-do compile { target c++11 } }
|
|
2
|
|
3 typedef long unsigned int size_t;
|
|
4
|
|
5 template<typename _Tp>
|
|
6 struct remove_reference {};
|
|
7
|
|
8 template<typename _Tp>
|
|
9 constexpr _Tp&&
|
|
10 forward(typename remove_reference<_Tp>::type& __t) noexcept
|
|
11 {
|
|
12 }
|
|
13
|
|
14 struct __allocator_traits_base {
|
|
15 template<typename _Tp, typename _Up, typename = void>
|
|
16 struct __rebind
|
|
17 {
|
|
18 using type = typename _Tp::template rebind<_Up>::other;
|
|
19 };
|
|
20 };
|
|
21
|
|
22 template<typename _Alloc, typename _Up>
|
|
23 using __alloc_rebind = typename __allocator_traits_base::template __rebind<_Alloc, _Up>::type;
|
|
24
|
|
25 template<typename _Alloc> struct allocator_traits {
|
|
26 template<typename _Tp> using rebind_alloc = __alloc_rebind<_Alloc, _Tp>;
|
|
27 template<typename _Tp, typename... _Args>
|
|
28 static auto construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
|
|
29 -> decltype(_S_construct(__a, __p, forward<_Args>(__args)...)) { }
|
|
30 };
|
|
31
|
|
32 template<typename _Alloc, typename = typename _Alloc::value_type>
|
|
33 struct __alloc_traits : allocator_traits<_Alloc> {
|
|
34 typedef allocator_traits<_Alloc> _Base_type;
|
|
35 template<typename _Tp> struct rebind { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
|
|
36 };
|
|
37
|
|
38 template<typename _Tp> class allocator {
|
|
39 typedef _Tp value_type;
|
|
40 template<typename _Tp1> struct rebind { typedef allocator<_Tp1> other; };
|
|
41 };
|
|
42
|
|
43 template<typename _CharT, typename _Alloc>
|
|
44 class basic_string {
|
|
45 typedef typename __alloc_traits<_Alloc>::template rebind<_CharT>::other _Char_alloc_type;
|
|
46 };
|
|
47
|
|
48 template<size_t _Nw> struct _Base_bitset {
|
|
49 static void foo (basic_string<char, allocator<char> >) {}
|
|
50 };
|