Put range check in the first position to clean up code

This commit is contained in:
Ion Gaztañaga
2025-09-21 11:12:09 +02:00
parent 1519d48135
commit 85ea77309b

View File

@@ -2100,8 +2100,8 @@ private:
>::type * = 0
)
{
typedef typename iter_size<FwdIt>::type it_size_type;
BOOST_ASSERT(this->priv_in_range_or_end(pos));
typedef typename iter_size<FwdIt>::type it_size_type;
const it_size_type sz = boost::container::iterator_udistance(first, last);
if (BOOST_UNLIKELY(sz > size_type(-1))){
boost::container::throw_length_error("vector::insert, FwdIt's max length reached");