diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index 1547ad6..b356e94 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -954,6 +954,7 @@ class flat_tree template void insert_equal(ordered_range_t, InIt first, InIt last) { + BOOST_ASSERT((is_sorted)(first, last, this->priv_value_comp())); const bool value = boost::container::dtl:: has_member_function_callable_with_merge_unique::value; (flat_tree_merge_equal)(this->m_data.m_seq, first, last, this->priv_value_comp(), dtl::bool_()); @@ -962,6 +963,7 @@ class flat_tree template void insert_unique(ordered_unique_range_t, InIt first, InIt last) { + BOOST_ASSERT((is_sorted_and_unique)(this->m_data.m_seq.cbegin(), this->m_data.m_seq.cend(), this->priv_value_comp())); const bool value = boost::container::dtl:: has_member_function_callable_with_merge_unique::value; (flat_tree_merge_unique)(this->m_data.m_seq, first, last, this->priv_value_comp(), dtl::bool_());