[range] insert not returning value for associative containers without 'before' iterator
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
On 12/4/2014 9:17 AM, Adam D. Walling wrote:
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?
You can use Trac to report a bug/problem or you can use a Github pull request. https://svn.boost.org/trac/boost/wiki/StartModPatchAndPullReq
participants (2)
-
Adam D. Walling
-
Edward Diener