| 1810 | //! <b>Complexity</b>: Amortized constant time. |
| 1811 | template<class ...Args> |
| 1812 | BOOST_CONTAINER_FORCEINLINE reference emplace_back(BOOST_FWD_REF(Args)...args) |
| 1813 | { |
| 1814 | T* const p = this->priv_raw_end(); |
| 1815 | if (BOOST_LIKELY(this->room_enough())){ |
| 1816 | //There is more memory, just construct a new object at the end |
| 1817 | allocator_traits_type::construct(this->m_holder.alloc(), p, ::boost::forward<Args>(args)...); |
| 1818 | ++this->m_holder.m_size; |
| 1819 | return *p; |
| 1820 | } |
| 1821 | else{ |
| 1822 | typedef dtl::insert_emplace_proxy<allocator_type, T*, Args...> proxy_t; |
| 1823 | return *this->priv_insert_forward_range_no_capacity |
| 1824 | (p, 1, proxy_t(::boost::forward<Args>(args)...), alloc_version()); |
| 1825 | } |
| 1826 | } |
| 1827 | |
| 1828 | //! <b>Effects</b>: Inserts an object of type T constructed with |
| 1829 | //! std::forward<Args>(args)... in the end of the vector. |