|
Boost Users : |
Subject: [Boost-users] [Range] Weak concept assertions.
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2012-05-03 11:21:13
Here's a snippet from boost/range/algorithm_ext/push_back.hpp...
namespace boost
{
namespace range
{
template< class Container, class Range >
inline Container& push_back( 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" );
on.insert( on.end(), boost::begin(from), boost::end(from) );
return on;
}
} // namespace range
using range::push_back;
} // namespace boost
Shouldn't the first concept assert be asserting that 'Container' is in fact
a container, not
a range?
Thx
- Rob.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net