diff options
author | Paolo Carlini <pcarlini@suse.de> | 2007-10-27 00:41:21 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2007-10-27 00:41:21 +0000 |
commit | 61fcb9fb0c6d18cb89d163b2228124af7173d54f (patch) | |
tree | 90a7feb935d3646f760bb5642127bacfc9aab08c /libstdc++-v3/include/ext/mt_allocator.h | |
parent | 00e65cfa892d1a2ed1e3f499df47acf7b797251b (diff) | |
download | gcc-61fcb9fb0c6d18cb89d163b2228124af7173d54f.zip gcc-61fcb9fb0c6d18cb89d163b2228124af7173d54f.tar.gz gcc-61fcb9fb0c6d18cb89d163b2228124af7173d54f.tar.bz2 |
throw_allocator.h (throw_allocator<>:: construct<>(pointer, _Args&&...)): Add.
2007-10-26 Paolo Carlini <pcarlini@suse.de>
* include/ext/throw_allocator.h (throw_allocator<>::
construct<>(pointer, _Args&&...)): Add.
* include/ext/pool_allocator.h (__pool_alloc<>::
construct<>(pointer, _Args&&...)): Likewise.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* include/ext/bitmap_allocator.h (bitmap_allocator<>::
construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* include/ext/new_allocator.h (new_allocator<>::
construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* include/ext/malloc_allocator.h (malloc_allocator<>::
construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* include/ext/array_allocator.h (array_allocator<>::
construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* include/ext/mt_allocator.h (__mt_alloc<>::
construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* testsuite/util/testsuite_allocator.h (tracker_allocator<>::
construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
(uneq_allocator<>::construct<>(pointer, _Args&&...)): Add.
(construct(pointer, const _Tp&)): Cast pointer to void*.
* testsuite/ext/mt_allocator/variadic_construct.cc: New.
* testsuite/ext/new_allocator/variadic_construct.cc: Likewise.
* testsuite/ext/throw_allocator/variadic_construct.cc: Likewise.
* testsuite/ext/malloc_allocator/variadic_construct.cc: Likewise.
* testsuite/ext/pool_allocator/variadic_construct.cc: Likewise.
* testsuite/ext/bitmap_allocator/variadic_construct.cc: Likewise.
* testsuite/ext/array_allocator/variadic_construct.cc: Likewise.
From-SVN: r129672
Diffstat (limited to 'libstdc++-v3/include/ext/mt_allocator.h')
-rw-r--r-- | libstdc++-v3/include/ext/mt_allocator.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h index 6083cdb..425a485 100644 --- a/libstdc++-v3/include/ext/mt_allocator.h +++ b/libstdc++-v3/include/ext/mt_allocator.h @@ -1,6 +1,6 @@ // MT-optimized allocator -*- C++ -*- -// Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +// Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -38,6 +38,7 @@ #include <cstdlib> #include <bits/functexcept.h> #include <ext/atomicity.h> +#include <bits/stl_move.h> _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) @@ -593,7 +594,14 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) // 402. wrong new expression in [some_] allocator::construct void construct(pointer __p, const _Tp& __val) - { ::new(__p) _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(); } |