forked from boostorg/range
Boost.Range fixes for Tickets: 4131, 4136, 4398, 4388. Plus updated history in the documentation.
[SVN r64111]
This commit is contained in:
@ -25,9 +25,9 @@ namespace boost
|
||||
template< class Map >
|
||||
struct select_first
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t;
|
||||
typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type&
|
||||
result_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
|
||||
typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type&
|
||||
result_type;
|
||||
|
||||
result_type operator()( const pair_t& r ) const
|
||||
{
|
||||
@ -38,8 +38,8 @@ namespace boost
|
||||
template< class Map >
|
||||
struct select_second_mutable
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type;
|
||||
|
||||
result_type operator()( pair_t& r ) const
|
||||
{
|
||||
@ -50,16 +50,16 @@ namespace boost
|
||||
template< class Map >
|
||||
struct select_second_const
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t;
|
||||
typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type&
|
||||
result_type;
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
|
||||
typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type&
|
||||
result_type;
|
||||
|
||||
result_type operator()( const pair_t& r ) const
|
||||
{
|
||||
return r.second;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template<class StdPairRng>
|
||||
class select_first_range
|
||||
: public transform_range<
|
||||
@ -78,7 +78,7 @@ namespace boost
|
||||
|
||||
select_first_range(const base& other) : base(other) {}
|
||||
};
|
||||
|
||||
|
||||
template<class StdPairRng>
|
||||
class select_second_mutable_range
|
||||
: public transform_range<
|
||||
@ -97,7 +97,7 @@ namespace boost
|
||||
|
||||
select_second_mutable_range(const base& other) : base(other) {}
|
||||
};
|
||||
|
||||
|
||||
template<class StdPairRng>
|
||||
class select_second_const_range
|
||||
: public transform_range<
|
||||
@ -116,20 +116,20 @@ namespace boost
|
||||
|
||||
select_second_const_range(const base& other) : base(other) {}
|
||||
};
|
||||
|
||||
|
||||
template< class StdPairRng >
|
||||
inline select_first_range<StdPairRng>
|
||||
inline select_first_range<StdPairRng>
|
||||
operator|( const StdPairRng& r, map_keys_forwarder )
|
||||
{
|
||||
return operator|( r,
|
||||
return operator|( r,
|
||||
boost::adaptors::transformed( select_first<StdPairRng>() ) );
|
||||
}
|
||||
|
||||
template< class StdPairRng >
|
||||
inline select_second_mutable_range<StdPairRng>
|
||||
inline select_second_mutable_range<StdPairRng>
|
||||
operator|( StdPairRng& r, map_values_forwarder )
|
||||
{
|
||||
return operator|( r,
|
||||
return operator|( r,
|
||||
boost::adaptors::transformed( select_second_mutable<StdPairRng>() ) );
|
||||
}
|
||||
|
||||
@ -137,27 +137,27 @@ namespace boost
|
||||
inline select_second_const_range<StdPairRng>
|
||||
operator|( const StdPairRng& r, map_values_forwarder )
|
||||
{
|
||||
return operator|( r,
|
||||
boost::adaptors::transformed( select_second_const<StdPairRng>() ) );
|
||||
return operator|( r,
|
||||
boost::adaptors::transformed( select_second_const<StdPairRng>() ) );
|
||||
}
|
||||
|
||||
|
||||
} // 'range_detail'
|
||||
|
||||
|
||||
using range_detail::select_first_range;
|
||||
using range_detail::select_second_mutable_range;
|
||||
using range_detail::select_second_const_range;
|
||||
|
||||
namespace adaptors
|
||||
{
|
||||
{
|
||||
namespace
|
||||
{
|
||||
const range_detail::map_keys_forwarder map_keys =
|
||||
const range_detail::map_keys_forwarder map_keys =
|
||||
range_detail::map_keys_forwarder();
|
||||
|
||||
const range_detail::map_values_forwarder map_values =
|
||||
const range_detail::map_values_forwarder map_values =
|
||||
range_detail::map_values_forwarder();
|
||||
}
|
||||
|
||||
|
||||
template<class StdPairRange>
|
||||
inline select_first_range<StdPairRange>
|
||||
keys(const StdPairRange& rng)
|
||||
@ -165,7 +165,7 @@ namespace boost
|
||||
return select_first_range<StdPairRange>(
|
||||
range_detail::select_first<StdPairRange>(), rng );
|
||||
}
|
||||
|
||||
|
||||
template<class StdPairRange>
|
||||
inline select_second_const_range<StdPairRange>
|
||||
values(const StdPairRange& rng)
|
||||
@ -173,7 +173,7 @@ namespace boost
|
||||
return select_second_const_range<StdPairRange>(
|
||||
range_detail::select_second_const<StdPairRange>(), rng );
|
||||
}
|
||||
|
||||
|
||||
template<class StdPairRange>
|
||||
inline select_second_mutable_range<StdPairRange>
|
||||
values(StdPairRange& rng)
|
||||
@ -182,7 +182,7 @@ namespace boost
|
||||
range_detail::select_second_mutable<StdPairRange>(), rng );
|
||||
}
|
||||
} // 'adaptors'
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user