Fixes Trac #11388 (boost::container::list::emplace_back broken on Visual Studio 2010)

This commit is contained in:
Ion Gaztañaga
2015-06-12 23:51:58 +02:00
parent ee998fb5b1
commit 61a2f49ef2
2 changed files with 20 additions and 82 deletions

View File

@@ -1099,12 +1099,12 @@ use [*Boost.Container]? There are several reasons for that:
[section:release_notes_boost_1_59_00 Boost 1.59 Release] [section:release_notes_boost_1_59_00 Boost 1.59 Release]
* [@https://github.com/boostorg/container/pull/26 GitHub #26: ['Fix bug in stable_vector::capacity()]]. Thanks to timsong-cpp/Arindam Mukerjee. * [@https://github.com/boostorg/container/pull/26 GitHub #26: ['Fix bug in stable_vector::capacity()]]. Thanks to timsong-cpp/Arindam Mukerjee.
* [@https://github.com/boostorg/container/pull/26 GitHub #27: ['fix stable_vector's index_of's doxygen comment]]. Thanks to kariya-mitsuru. * [@https://github.com/boostorg/container/pull/27 GitHub #27: ['fix stable_vector's index_of's doxygen comment]]. Thanks to kariya-mitsuru.
* [@https://svn.boost.org/trac/boost/ticket/11380 Trac #11380: ['"Container library std forward declarations incorrect in std_fwd.hpp on libc++ with gcc"]]. * [@https://svn.boost.org/trac/boost/ticket/11380 Trac #11380: ['"Container library std forward declarations incorrect in std_fwd.hpp on libc++ with gcc"]].
* [@https://svn.boost.org/trac/boost/ticket/11388 Trac #11388: ['"boost::container::list::emplace_back broken on Visual Studio 2010"]].
[endsect] [endsect]
https://github.com/boostorg/container/pull/26
[section:release_notes_boost_1_58_00 Boost 1.58 Release] [section:release_notes_boost_1_58_00 Boost 1.58 Release]
* Experimental [classref boost::container::small_vector small_vector] container. * Experimental [classref boost::container::small_vector small_vector] container.
* Massive dependency reorganization. Now [*Boost.Container] depends on very basic utilities like Boost.Core * Massive dependency reorganization. Now [*Boost.Container] depends on very basic utilities like Boost.Core

View File

@@ -173,87 +173,25 @@ struct node_alloc_holder
} }
#else //defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #else //defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
NodePtr create_node()
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
(this->node_alloc(), container_detail::addressof(p->m_data));
node_deallocator.release();
typedef typename Node::hook_type hook_type;
::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type;
return (p);
}
template<BOOST_MOVE_CLASS1> #define BOOST_CONTAINER_NODE_ALLOC_HOLDER_CONSTRUCT_IMPL(N) \
NodePtr create_node(BOOST_MOVE_UREF1) BOOST_MOVE_TMPL_LT##N BOOST_MOVE_CLASS##N BOOST_MOVE_GT##N \
{ NodePtr create_node(BOOST_MOVE_UREF##N)\
NodePtr p = this->allocate_one(); {\
Deallocator node_deallocator(p, this->node_alloc()); NodePtr p = this->allocate_one();\
allocator_traits<NodeAlloc>::construct Deallocator node_deallocator(p, this->node_alloc());\
(this->node_alloc(), container_detail::addressof(p->m_data) allocator_traits<NodeAlloc>::construct\
, BOOST_MOVE_FWD1); ( this->node_alloc()\
node_deallocator.release(); , container_detail::addressof(p->m_data)\
typedef typename Node::hook_type hook_type; BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type; node_deallocator.release();\
return (p); typedef typename Node::hook_type hook_type;\
} ::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type;\
return (p);\
template<BOOST_MOVE_CLASS2> }\
NodePtr create_node(BOOST_MOVE_UREF2) //
{ BOOST_MOVE_ITERATE_0TO9(BOOST_CONTAINER_NODE_ALLOC_HOLDER_CONSTRUCT_IMPL)
NodePtr p = this->allocate_one(); #undef BOOST_CONTAINER_NODE_ALLOC_HOLDER_CONSTRUCT_IMPL
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
(this->node_alloc(), container_detail::addressof(p->m_data)
, BOOST_MOVE_FWD2);
node_deallocator.release();
typedef typename Node::hook_type hook_type;
::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type;
return (p);
}
template<BOOST_MOVE_CLASS3>
NodePtr create_node(BOOST_MOVE_UREF3)
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
(this->node_alloc(), container_detail::addressof(p->m_data)
, BOOST_MOVE_FWD3);
node_deallocator.release();
typedef typename Node::hook_type hook_type;
::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type;
return (p);
}
template<BOOST_MOVE_CLASS4>
NodePtr create_node(BOOST_MOVE_UREF4)
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
(this->node_alloc(), container_detail::addressof(p->m_data)
, BOOST_MOVE_FWD4);
node_deallocator.release();
typedef typename Node::hook_type hook_type;
::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type;
return (p);
}
template<BOOST_MOVE_CLASS5>
NodePtr create_node(BOOST_MOVE_UREF5)
{
NodePtr p = this->allocate_one();
Deallocator node_deallocator(p, this->node_alloc());
allocator_traits<NodeAlloc>::construct
(this->node_alloc(), container_detail::addressof(p->m_data)
, BOOST_MOVE_FWD5);
node_deallocator.release();
typedef typename Node::hook_type hook_type;
::new(static_cast<hook_type*>(container_detail::to_raw_pointer(p)), boost_container_new_t()) hook_type;
return (p);
}
#endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) #endif // !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)