aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/mt_allocator.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely.gcc@gmail.com>2011-05-28 13:27:43 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2011-05-28 14:27:43 +0100
commit45ba8f9f8f6806d4598b41fff8826ecb63a67092 (patch)
tree3395bb512611d5a4c57824500bd0bd037124d510 /libstdc++-v3/include/ext/mt_allocator.h
parent7ca2afa0c3a41bb26c80fdeffc2cef044c5feec1 (diff)
downloadgcc-45ba8f9f8f6806d4598b41fff8826ecb63a67092.zip
gcc-45ba8f9f8f6806d4598b41fff8826ecb63a67092.tar.gz
gcc-45ba8f9f8f6806d4598b41fff8826ecb63a67092.tar.bz2
Makefile.am: Add new ptr_traits.h header.
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. From-SVN: r174380
Diffstat (limited to 'libstdc++-v3/include/ext/mt_allocator.h')
-rw-r--r--libstdc++-v3/include/ext/mt_allocator.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h
index 91eac24..9281494 100644
--- a/libstdc++-v3/include/ext/mt_allocator.h
+++ b/libstdc++-v3/include/ext/mt_allocator.h
@@ -588,21 +588,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
};
#ifdef __GTHREADS