trac_8693 const cast warn

This commit is contained in:
Neil Groves
2014-02-26 22:02:27 +00:00
parent 665477de19
commit 259e917eaf
3 changed files with 17 additions and 4 deletions

View File

@ -15,6 +15,7 @@
#include <boost/range/difference_type.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/detail/implementation_help.hpp>
#include <boost/assert.hpp>
namespace boost
@ -27,8 +28,8 @@ inline Container& push_front( Container& on, const Range& from )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<Container> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const Range> ));
BOOST_ASSERT( (void*)&on != (void*)&from &&
"cannot copy from a container to itself" );
BOOST_ASSERT_MSG(!range_detail::is_same_object(on, from),
"cannot copy from a container to itself");
on.insert( on.begin(), boost::begin(from), boost::end(from) );
return on;
}