Ticket 9851 - adaptors should perform concept check assertions.

This commit is contained in:
Neil Groves
2014-05-06 23:37:21 +01:00
parent d7fde2736c
commit 5f2560f753
52 changed files with 1134 additions and 129 deletions

View File

@ -15,6 +15,7 @@
#include <boost/range/iterator_range.hpp>
#include <boost/range/value_type.hpp>
#include <boost/range/reference.hpp>
#include <boost/range/concepts.hpp>
namespace boost
{
@ -120,6 +121,9 @@ namespace boost
inline select_first_range<StdPairRng>
operator|( const StdPairRng& r, map_keys_forwarder )
{
BOOST_RANGE_CONCEPT_ASSERT((
SinglePassRangeConcept<const StdPairRng>));
return operator|( r,
boost::adaptors::transformed( select_first<StdPairRng>() ) );
}
@ -128,6 +132,8 @@ namespace boost
inline select_second_mutable_range<StdPairRng>
operator|( StdPairRng& r, map_values_forwarder )
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<StdPairRng>));
return operator|( r,
boost::adaptors::transformed( select_second_mutable<StdPairRng>() ) );
}
@ -136,6 +142,9 @@ namespace boost
inline select_second_const_range<StdPairRng>
operator|( const StdPairRng& r, map_values_forwarder )
{
BOOST_RANGE_CONCEPT_ASSERT((
SinglePassRangeConcept<const StdPairRng>));
return operator|( r,
boost::adaptors::transformed( select_second_const<StdPairRng>() ) );
}
@ -161,6 +170,9 @@ namespace boost
inline select_first_range<StdPairRange>
keys(const StdPairRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT((
SinglePassRangeConcept<const StdPairRange>));
return select_first_range<StdPairRange>(
range_detail::select_first<StdPairRange>(), rng );
}
@ -169,6 +181,9 @@ namespace boost
inline select_second_const_range<StdPairRange>
values(const StdPairRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT((
SinglePassRangeConcept<const StdPairRange>));
return select_second_const_range<StdPairRange>(
range_detail::select_second_const<StdPairRange>(), rng );
}
@ -177,6 +192,8 @@ namespace boost
inline select_second_mutable_range<StdPairRange>
values(StdPairRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<StdPairRange>));
return select_second_mutable_range<StdPairRange>(
range_detail::select_second_mutable<StdPairRange>(), rng );
}