Fixed GitHub #98: ("flat_map: insert_or_assign does not work with hint")

This commit is contained in:
Ion Gaztañaga
2019-02-02 00:25:09 +01:00
parent b5c25ea058
commit 81d78dbefa
4 changed files with 45 additions and 12 deletions
+2 -2
View File
@@ -788,7 +788,7 @@ class flat_map
//! Complexity: Logarithmic in the size of the container in general, but amortized constant if
//! the new element is inserted just before hint.
template <class M>
BOOST_CONTAINER_FORCEINLINE iterator insert_or_assign(const_iterator hint, const key_type& k, BOOST_FWD_REF(M) obj)
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> insert_or_assign(const_iterator hint, const key_type& k, BOOST_FWD_REF(M) obj)
{
return dtl::force_copy< std::pair<iterator, bool> >
(this->m_flat_tree.insert_or_assign
@@ -812,7 +812,7 @@ class flat_map
//! Complexity: Logarithmic in the size of the container in general, but amortized constant if
//! the new element is inserted just before hint.
template <class M>
BOOST_CONTAINER_FORCEINLINE iterator insert_or_assign(const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj)
BOOST_CONTAINER_FORCEINLINE std::pair<iterator, bool> insert_or_assign(const_iterator hint, BOOST_RV_REF(key_type) k, BOOST_FWD_REF(M) obj)
{
return dtl::force_copy< std::pair<iterator, bool> >
(this->m_flat_tree.insert_or_assign