diff options
author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-10 18:08:35 +0000 |
---|---|---|
committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-10 18:08:35 +0000 |
commit | 35c730f29bd5690c463497576b4d0e77eac01be8 (patch) | |
tree | a5f3ef6ecf2264b35f8ef426c1265d573200c8de /libstdc++-v3/include/experimental | |
parent | a00ef6ba893e9b01bbcad806197ebc7ca4e461e5 (diff) | |
download | gcc-35c730f29bd5690c463497576b4d0e77eac01be8.tar.gz |
* include/experimental/any (any::_Manager_alloc::_Data): Reorder
tuple members to simplify pretty printing.
(any::_Manager_alloc::_Data::_M_construct): Fix uses-allocator
construction.
* testsuite/experimental/any/cons/4.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212435 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/experimental')
-rw-r--r-- | libstdc++-v3/include/experimental/any | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any index a69d0067fd9..a4ac983d711 100644 --- a/libstdc++-v3/include/experimental/any +++ b/libstdc++-v3/include/experimental/any @@ -450,18 +450,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { using _Traits = std::allocator_traits<_Alloc>; - std::tuple<_Alloc, __gnu_cxx::__aligned_buffer<_Tp>> _M_data; + std::tuple<__gnu_cxx::__aligned_buffer<_Tp>, _Alloc> _M_data; - _Alloc& _M_alloc() { return std::get<0>(_M_data); } - const _Alloc& _M_alloc() const { return std::get<0>(_M_data); } + _Alloc& _M_alloc() { return std::get<1>(_M_data); } + const _Alloc& _M_alloc() const { return std::get<1>(_M_data); } - _Tp* _M_obj() { return std::get<1>(_M_data)._M_ptr(); } - const _Tp* _M_obj() const { return std::get<1>(_M_data)._M_ptr(); } + _Tp* _M_obj() { return std::get<0>(_M_data)._M_ptr(); } + const _Tp* _M_obj() const { return std::get<0>(_M_data)._M_ptr(); } template<typename _Up> - _Data(const _Alloc& __a, _Up&& __val) : _M_data(__a, nullptr) + _Data(const _Alloc& __a, _Up&& __val) : _M_data(nullptr, __a) { - this->_M_construct(std::__use_alloc<_Tp>(_M_alloc()), + this->_M_construct(std::__use_alloc<_Tp, _Alloc, _Up&&>(_M_alloc()), std::forward<_Up>(__val)); } @@ -479,8 +479,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION void _M_construct(__uses_alloc1<_Alloc> __a, _Up&& __val) { - _Traits::construct(__a._M_a, _M_obj(), - std::allocator_arg, __a._M_a, + _Traits::construct(_M_alloc(), _M_obj(), + std::allocator_arg, *__a._M_a, std::forward<_Up>(__val)); } @@ -488,8 +488,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION void _M_construct(__uses_alloc2<_Alloc> __a, _Up&& __val) { - _Traits::construct(__a._M_a, _M_obj(), - std::forward<_Up>(__val), __a._M_a); + _Traits::construct(_M_alloc(), _M_obj(), + std::forward<_Up>(__val), *__a._M_a); } }; |