Boost logo

Boost :

Subject: [boost] [range] insert not returning value for associative containers without 'before' iterator
From: Adam D. Walling (adam.walling_at_[hidden])
Date: 2014-12-04 09:17:23


The modification to boost/range/algorithm_ext/insert.hpp added an insert
overload which does not take a 'before' iterator, but the implementation
fails to return the Container passed in as it is supposed to. This causes
the compiler to fail (eg with error C4716 must return a value in MSVC).

https://svn.boost.org/trac/boost/ticket/6726

Fix is to simply add 'return on':

template< class Container, class Range >
inline Container& insert( Container& on, const Range& from )
{
    BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<Container> ));
    BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Range> ));
    on.insert(boost::begin(from), boost::end(from));
+ return on;
}

Admittedly I am uncertain how bugs are being tracked now; is trac still
being used or something on github?

Thanks,

Adam D. Walling


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk