summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/std/scoped_allocator
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-07 07:27:06 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-07 07:27:06 +0000
commite12e4f3b3ea8d636d0b78d31b94367d9a89a4178 (patch)
tree45eb6d5a21849a3b8684ed93cfe2f669d22f0ca5 /libstdc++-v3/include/std/scoped_allocator
parentcfec59d0f530ffe840eb0609ac11a30fb00a4096 (diff)
downloadppe42-gcc-e12e4f3b3ea8d636d0b78d31b94367d9a89a4178.tar.gz
ppe42-gcc-e12e4f3b3ea8d636d0b78d31b94367d9a89a4178.zip
2011-08-06 Benjamin Kosnik <bkoz@redhat.com>
* doc/doxygen/user.cfg.in (PDF_HYPERLINKS): To NO. 2011-08-06 Benjamin Kosnik <bkoz@redhat.com> * doc/doxygen/user.cfg.in: Add scoped_allocator. * include/debug/safe_sequence.h: Fix doxygen markup. * include/debug/safe_unordered_base.h: Same. * include/debug/safe_local_iterator.tcc: Same. * include/debug/safe_unordered_container.h: Same. * include/std/valarray: Same. * include/std/iomanip: Same. * include/std/streambuf: Same. * include/std/bitset: Same. * include/std/fstream: Same. * include/std/functional: Same. * include/std/istream: Same. * include/std/ostream: Same. * include/std/scoped_allocator: Same. * include/std/sstream: Same. * include/parallel/multiway_merge.h: Same. * include/parallel/base.h: Same. * include/parallel/for_each_selectors.h: Same. * include/parallel/multiway_mergesort.h: Same. * include/parallel/search.h: Same. * include/parallel/partial_sum.h: Same. * include/parallel/queue.h: Same. * include/parallel/sort.h: Same. * include/parallel/random_number.h: Same. * include/ext/vstring.h: Same. * include/ext/algorithm: Same. * include/ext/pb_ds/assoc_container.h: Same. * include/ext/bitmap_allocator.h: Same. * include/ext/stdio_filebuf.h: Same. * include/ext/memory: Same. * include/ext/functional: Same. * include/bits/basic_ios.h: Same. * include/bits/stl_list.h: Same. * include/bits/stl_map.h: Same. * include/bits/stl_algobase.h: Same. * include/bits/stl_queue.h: Same. * include/bits/gslice.h: Same. * include/bits/locale_classes.h: Same. * include/bits/stl_set.h: Same. * include/bits/locale_facets.h: Same. * include/bits/stl_stack.h: Same. * include/bits/stl_heap.h: Same. * include/bits/forward_list.h: Same. * include/bits/stream_iterator.h: Same. * include/bits/basic_string.h: Same. * include/bits/stl_multimap.h: Same. * include/bits/stl_pair.h: Same. * include/bits/ios_base.h: Same. * include/bits/stl_numeric.h: Same. * include/bits/stl_vector.h: Same. * include/bits/stl_deque.h: Same. * include/bits/codecvt.h: Same. * include/bits/stl_multiset.h: Same. * include/bits/stl_uninitialized.h: Same. * include/bits/ptr_traits.h: Same. * include/bits/slice_array.h: Same. * include/bits/stl_iterator_base_funcs.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_tempbuf.h: Same. * include/bits/regex.h: Same. * include/bits/range_access.h: Same. * include/bits/random.h: Same. * include/bits/alloc_traits.h: Same. * include/bits/regex_error.h: Same. * include/bits/locale_facets_nonio.h: Same. * include/bits/stl_relops.h: Same. * include/backward/auto_ptr.h: Same. * libsupc++/initializer_list: Same. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Adjust line numbers. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Same. * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc: Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177542 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/scoped_allocator')
-rw-r--r--libstdc++-v3/include/std/scoped_allocator139
1 files changed, 77 insertions, 62 deletions
diff --git a/libstdc++-v3/include/std/scoped_allocator b/libstdc++-v3/include/std/scoped_allocator
index bde996c42b3..bebbbd29cc9 100644
--- a/libstdc++-v3/include/std/scoped_allocator
+++ b/libstdc++-v3/include/std/scoped_allocator
@@ -93,72 +93,84 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _OuterAlloc, typename... _InnerAllocs>
class scoped_allocator_adaptor;
- template<typename...> struct __inner_type_impl;
+ template<typename...>
+ struct __inner_type_impl;
- template<typename _Outer>
- struct __inner_type_impl<_Outer>
- {
- typedef scoped_allocator_adaptor<_Outer> __type;
-
- __inner_type_impl() = default;
- __inner_type_impl(const __inner_type_impl&) = default;
- __inner_type_impl(__inner_type_impl&&) = default;
-
- template<typename _Alloc>
- __inner_type_impl(const __inner_type_impl<_Alloc>& __other)
- { }
-
- template<typename _Alloc>
- __inner_type_impl(__inner_type_impl<_Alloc>&& __other)
- { }
-
- __type& _M_get(__type* __p) noexcept { return *__p; }
- const __type& _M_get(const __type* __p) const noexcept { return *__p; }
-
- tuple<> _M_tie() const noexcept { return tuple<>(); }
-
- bool operator==(const __inner_type_impl&) const noexcept
- { return true; }
- };
-
- template<typename _Outer, typename _InnerHead, typename... _InnerTail>
- struct __inner_type_impl<_Outer, _InnerHead, _InnerTail...>
- {
- typedef scoped_allocator_adaptor<_InnerHead, _InnerTail...> __type;
-
- __inner_type_impl() = default;
- __inner_type_impl(const __inner_type_impl&) = default;
- __inner_type_impl(__inner_type_impl&&) = default;
-
- template<typename... _Allocs>
- __inner_type_impl(const __inner_type_impl<_Allocs...>& __other)
- : _M_inner(__other._M_inner) { }
-
- template<typename... _Allocs>
- __inner_type_impl(__inner_type_impl<_Allocs...>&& __other)
- : _M_inner(std::move(__other._M_inner)) { }
-
- template<typename... _Args>
- explicit
- __inner_type_impl(_Args&&... __args)
- : _M_inner(std::forward<_Args>(__args)...) { }
+ template<typename _Outer>
+ struct __inner_type_impl<_Outer>
+ {
+ typedef scoped_allocator_adaptor<_Outer> __type;
- __type& _M_get(void*) noexcept { return _M_inner; }
- const __type& _M_get(const void*) const noexcept { return _M_inner; }
+ __inner_type_impl() = default;
+ __inner_type_impl(const __inner_type_impl&) = default;
+ __inner_type_impl(__inner_type_impl&&) = default;
+
+ template<typename _Alloc>
+ __inner_type_impl(const __inner_type_impl<_Alloc>& __other)
+ { }
+
+ template<typename _Alloc>
+ __inner_type_impl(__inner_type_impl<_Alloc>&& __other)
+ { }
+
+ __type&
+ _M_get(__type* __p) noexcept { return *__p; }
- tuple<const _InnerHead&, const _InnerTail&...> _M_tie() const noexcept
- { return _M_inner._M_tie(); }
+ const __type&
+ _M_get(const __type* __p) const noexcept { return *__p; }
+
+ tuple<>
+ _M_tie() const noexcept { return tuple<>(); }
+
+ bool
+ operator==(const __inner_type_impl&) const noexcept
+ { return true; }
+ };
- bool operator==(const __inner_type_impl& __other) const noexcept
- { return _M_inner == __other._M_inner; }
+ template<typename _Outer, typename _InnerHead, typename... _InnerTail>
+ struct __inner_type_impl<_Outer, _InnerHead, _InnerTail...>
+ {
+ typedef scoped_allocator_adaptor<_InnerHead, _InnerTail...> __type;
+
+ __inner_type_impl() = default;
+ __inner_type_impl(const __inner_type_impl&) = default;
+ __inner_type_impl(__inner_type_impl&&) = default;
+
+ template<typename... _Allocs>
+ __inner_type_impl(const __inner_type_impl<_Allocs...>& __other)
+ : _M_inner(__other._M_inner) { }
+
+ template<typename... _Allocs>
+ __inner_type_impl(__inner_type_impl<_Allocs...>&& __other)
+ : _M_inner(std::move(__other._M_inner)) { }
- private:
- template<typename...> friend class __inner_type_impl;
- template<typename, typename...> friend class scoped_allocator_adaptor;
+ template<typename... _Args>
+ explicit
+ __inner_type_impl(_Args&&... __args)
+ : _M_inner(std::forward<_Args>(__args)...) { }
- __type _M_inner;
- };
+ __type&
+ _M_get(void*) noexcept { return _M_inner; }
+
+ const __type&
+ _M_get(const void*) const noexcept { return _M_inner; }
+
+ tuple<const _InnerHead&, const _InnerTail&...>
+ _M_tie() const noexcept
+ { return _M_inner._M_tie(); }
+
+ bool
+ operator==(const __inner_type_impl& __other) const noexcept
+ { return _M_inner == __other._M_inner; }
+
+ private:
+ template<typename...> friend class __inner_type_impl;
+ template<typename, typename...> friend class scoped_allocator_adaptor;
+
+ __type _M_inner;
+ };
+ /// Primary class template.
template<typename _OuterAlloc, typename... _InnerAllocs>
class scoped_allocator_adaptor
: public _OuterAlloc
@@ -180,7 +192,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename... _Args>
- void _M_construct(__uses_alloc0, _Tp* __p, _Args&&... __args)
+ void
+ _M_construct(__uses_alloc0, _Tp* __p, _Args&&... __args)
{
auto& __outer = __outermost(*this);
typedef typename std::decay<decltype(__outer)>::type __outer_type;
@@ -192,7 +205,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef __uses_alloc2<typename __inner_type::__type> __uses_alloc2_;
template<typename _Tp, typename... _Args>
- void _M_construct(__uses_alloc1_, _Tp* __p, _Args&&... __args)
+ void
+ _M_construct(__uses_alloc1_, _Tp* __p, _Args&&... __args)
{
auto& __outer = __outermost(*this);
typedef typename std::decay<decltype(__outer)>::type __outer_type;
@@ -202,7 +216,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
template<typename _Tp, typename... _Args>
- void _M_construct(__uses_alloc2_, _Tp* __p, _Args&&... __args)
+ void
+ _M_construct(__uses_alloc2_, _Tp* __p, _Args&&... __args)
{
auto& __outer = __outermost(*this);
typedef typename std::decay<decltype(__outer)>::type __outer_type;
OpenPOWER on IntegriCloud