diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-28 13:27:43 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-28 13:27:43 +0000 |
commit | 2414d57e8911b56b49b5d70ca62137ceb0f19b61 (patch) | |
tree | 3395bb512611d5a4c57824500bd0bd037124d510 /libstdc++-v3/include/ext/pool_allocator.h | |
parent | 6142f56ee90aca4a30d4045991a78e03f4b50e07 (diff) | |
download | gcc-2414d57e8911b56b49b5d70ca62137ceb0f19b61.tar.gz |
2011-05-28 Jonathan Wakely <jwakely.gcc@gmail.com>
* include/Makefile.am: Add new ptr_traits.h header.
* include/Makefile.in: Regenerate.
* include/bits/ptr_traits.h (pointer_traits): New.
* include/bits/allocator.h (allocator_traits): Add.
* include/ext/array_allocator.h (construct, destroy): Update C++0x
versions.
* include/ext/bitmap_allocator.h (construct, destroy): Likewise.
* include/ext/extptr_allocator.h (construct, destroy): Likewise.
* include/ext/malloc_allocator.h (construct, destroy): Likewise.
* include/ext/mt_allocator.h (construct, destroy): Likewise.
* include/ext/new_allocator.h (construct, destroy): Likewise.
* include/ext/pool_allocator.h (construct, destroy): Likewise.
* include/ext/throw_allocator.h (construct, destroy): Likewise.
* testsuite/20_util/allocator_traits/requirements/typedefs.cc: New.
* testsuite/20_util/allocator_traits/requirements/
explicit_instantiation.cc: New.
* testsuite/20_util/allocator_traits/members/max_size.cc: New.
* testsuite/20_util/allocator_traits/members/select.cc: New.
* testsuite/20_util/allocator_traits/members/construct.cc: New.
* testsuite/20_util/allocator_traits/members/allocate_hint.cc: New.
* testsuite/20_util/allocator_traits/members/destroy.cc: New.
* testsuite/20_util/pointer_traits/requirements/typedefs.cc: New.
* testsuite/20_util/pointer_traits/requirements/
explicit_instantiation.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174380 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext/pool_allocator.h')
-rw-r--r-- | libstdc++-v3/include/ext/pool_allocator.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h index 66ddced8054..9a47b191fc6 100644 --- a/libstdc++-v3/include/ext/pool_allocator.h +++ b/libstdc++-v3/include/ext/pool_allocator.h @@ -158,21 +158,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION max_size() const throw() { return size_t(-1) / sizeof(_Tp); } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template<typename _Up, typename... _Args> + void + construct(_Up* __p, _Args&&... __args) + { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); } + + template<typename _Up> + void + destroy(_Up* __p) { __p->~_Up(); } +#else // _GLIBCXX_RESOLVE_LIB_DEFECTS // 402. wrong new expression in [some_] allocator::construct void construct(pointer __p, const _Tp& __val) { ::new((void *)__p) _Tp(__val); } -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - template<typename... _Args> - void - construct(pointer __p, _Args&&... __args) - { ::new((void *)__p) _Tp(std::forward<_Args>(__args)...); } -#endif - void destroy(pointer __p) { __p->~_Tp(); } +#endif pointer allocate(size_type __n, const void* = 0); |