Merge branch 'develop'

This commit is contained in:
Ion Gaztañaga
2017-02-24 22:09:25 +01:00
2 changed files with 8 additions and 5 deletions

View File

@@ -1217,8 +1217,9 @@ use [*Boost.Container]? There are several reasons for that:
[section:release_notes_boost_1_64_00 Boost 1.64 Release]
* Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/12749 Trac #12749: ['"container::pmr::polymorphic_allocator compilation error"]].
* [@https://svn.boost.org/trac/boost/ticket/11333 Trac #11333: ['"boost::basic_string_ref should interop with boost::container::basic_string"]].
* [@https://svn.boost.org/trac/boost/ticket/12749 Trac #12749: ['"container::pmr::polymorphic_allocator compilation error"]].
* [@https://svn.boost.org/trac/boost/ticket/11333 Trac #11333: ['"boost::basic_string_ref should interop with boost::container::basic_string"]].
* [@https://github.com/boostorg/container/pull/45 GitHub #45: ['"emplace_back must return reference to back(), not to *end()"]].
[endsect]

View File

@@ -1735,9 +1735,10 @@ class vector
{
if (BOOST_LIKELY(this->room_enough())){
//There is more memory, just construct a new object at the end
allocator_traits_type::construct(this->m_holder.alloc(), this->priv_raw_end(), ::boost::forward<Args>(args)...);
T* const p = this->priv_raw_end();
allocator_traits_type::construct(this->m_holder.alloc(), p, ::boost::forward<Args>(args)...);
++this->m_holder.m_size;
return *this->priv_raw_end();
return *p;
}
else{
typedef container_detail::insert_emplace_proxy<Allocator, T*, Args...> type;
@@ -1793,10 +1794,11 @@ class vector
BOOST_CONTAINER_FORCEINLINE reference emplace_back(BOOST_MOVE_UREF##N)\
{\
if (BOOST_LIKELY(this->room_enough())){\
T* const p = this->priv_raw_end();\
allocator_traits_type::construct (this->m_holder.alloc()\
, this->priv_raw_end() BOOST_MOVE_I##N BOOST_MOVE_FWD##N);\
++this->m_holder.m_size;\
return *this->priv_raw_end();\
return *p;\
}\
else{\
typedef container_detail::insert_emplace_proxy_arg##N<Allocator, T* BOOST_MOVE_I##N BOOST_MOVE_TARG##N> type;\