[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

View File

@ -91,6 +91,11 @@ namespace range_detail
} // namespace 'range_detail'
#endif
// Use a ADL namespace barrier to avoid ambiguity with other unqualified
// calls. This is particularly important with C++0x encouraging
// unqualified calls to begin/end.
namespace range_adl_barrier
{
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
@ -114,19 +119,25 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
return range_begin( r );
}
} // namespace range_adl_barrier
} // namespace boost
#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
namespace boost
{
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
const_begin( const T& r )
namespace range_adl_barrier
{
return boost::begin( r );
}
}
template< class T >
inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
const_begin( const T& r )
{
return boost::range_adl_barrier::begin( r );
}
} // namespace range_adl_barrier
using namespace range_adl_barrier;
} // namespace boost
#endif