diff options
| author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-08 20:30:44 +0000 |
|---|---|---|
| committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-08 20:30:44 +0000 |
| commit | a05f57b77402f7a47cbc7d784ae588c5f9798dc7 (patch) | |
| tree | 9da00e0862c14bafa99e669a57ce7251801cc0f7 /libstdc++-v3/include/std/future | |
| parent | ca601f81572c4e527752b0a5f773a4a08816be67 (diff) | |
| download | ppe42-gcc-a05f57b77402f7a47cbc7d784ae588c5f9798dc7.tar.gz ppe42-gcc-a05f57b77402f7a47cbc7d784ae588c5f9798dc7.zip | |
2010-10-08 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/future (_Result_alloc): Derive from _Alloc,
exploit the Empty Base Optimization.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165194 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/future')
| -rw-r--r-- | libstdc++-v3/include/std/future | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libstdc++-v3/include/std/future b/libstdc++-v3/include/std/future index ff566983ca2..2933c8be63f 100644 --- a/libstdc++-v3/include/std/future +++ b/libstdc++-v3/include/std/future @@ -215,24 +215,22 @@ namespace std /// Result_alloc. template<typename _Res, typename _Alloc> - struct _Result_alloc : _Result<_Res> + struct _Result_alloc : _Result<_Res>, _Alloc { typedef typename _Alloc::template rebind<_Result_alloc>::other __allocator_type; explicit - _Result_alloc(const _Alloc& __a) : _Result<_Res>(), _M_alloc(__a) + _Result_alloc(const _Alloc& __a) : _Result<_Res>(), _Alloc(__a) { } private: void _M_destroy() { - __allocator_type __a(_M_alloc); + __allocator_type __a(*this); __a.destroy(this); __a.deallocate(this, 1); } - - __allocator_type _M_alloc; }; template<typename _Res, typename _Allocator> |

