[boost][range] - Updated begin/end to be protected against accidental ADL to improve compatibility with C++0x. Added any_range which adds type erasure support. Added a type_erased adaptor to utilise the any_range. Implemented the any_iterator using a small buffer optimization to avoid heap usage.

[SVN r67541]
This commit is contained in:
Neil Groves
2011-01-01 16:46:32 +00:00
parent c506d2537f
commit 55fd3ca5b2
122 changed files with 4087 additions and 594 deletions

28
include/boost/range/detail/begin.hpp Executable file → Normal file
View File

@ -19,9 +19,9 @@
# include <boost/range/value_type.hpp>
#endif
namespace boost
namespace boost
{
namespace range_detail
{
template< typename T >
@ -30,7 +30,7 @@ namespace boost
//////////////////////////////////////////////////////////////////////
// default
//////////////////////////////////////////////////////////////////////
template<>
struct range_begin<std_container_>
{
@ -40,11 +40,11 @@ namespace boost
return c.begin();
};
};
//////////////////////////////////////////////////////////////////////
// pair
//////////////////////////////////////////////////////////////////////
template<>
struct range_begin<std_pair_>
{
@ -54,11 +54,11 @@ namespace boost
return p.first;
}
};
//////////////////////////////////////////////////////////////////////
// array
//////////////////////////////////////////////////////////////////////
template<>
struct range_begin<array_>
{
@ -78,14 +78,16 @@ namespace boost
};
} // namespace 'range_detail'
template< typename C >
inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
begin( C& c )
namespace range_adl_barrier
{
return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
template< typename C >
inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
begin( C& c )
{
return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
}
}
} // namespace 'boost'