mirror of
https://github.com/boostorg/range.git
synced 2025-07-18 23:22:13 +02:00
updated naming convention
[SVN r24517]
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
namespace range_detail
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -34,14 +34,14 @@ namespace range
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
inline BOOST_DEDUCED_TYPENAME const_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_const_iterator<C>::type
|
||||
begin( const C& c )
|
||||
{
|
||||
return c.begin();
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
inline BOOST_DEDUCED_TYPENAME iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
|
||||
begin( C& c )
|
||||
{
|
||||
return c.begin();
|
||||
@ -104,28 +104,28 @@ namespace range
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace 'range'
|
||||
} // namespace 'range_detail'
|
||||
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME iterator_of<T>::type begin( T& r )
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
using range::begin;
|
||||
using range_detail::begin;
|
||||
return begin( r );
|
||||
#else
|
||||
return range::begin( r );
|
||||
return range_detail::begin( r );
|
||||
#endif
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME const_iterator_of<T>::type begin( const T& r )
|
||||
inline BOOST_DEDUCED_TYPENAME range_const_iterator<T>::type begin( const T& r )
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
using range::begin;
|
||||
using range_detail::begin;
|
||||
return begin( r );
|
||||
#else
|
||||
return range::begin( r );
|
||||
return range_detail::begin( r );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct const_iterator_of
|
||||
struct range_const_iterator
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME C::const_iterator type;
|
||||
};
|
||||
@ -41,13 +41,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct const_iterator_of< std::pair<Iterator,Iterator> >
|
||||
struct range_const_iterator< std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef Iterator type;
|
||||
};
|
||||
|
||||
template< typename Iterator >
|
||||
struct const_iterator_of< const std::pair<Iterator,Iterator> >
|
||||
struct range_const_iterator< const std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef Iterator type;
|
||||
};
|
||||
@ -57,13 +57,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct const_iterator_of< T[sz] >
|
||||
struct range_const_iterator< T[sz] >
|
||||
{
|
||||
typedef const T* type;
|
||||
};
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct const_iterator_of< const T[sz] >
|
||||
struct range_const_iterator< const T[sz] >
|
||||
{
|
||||
typedef const T* type;
|
||||
};
|
||||
@ -73,25 +73,25 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct const_iterator_of< char* >
|
||||
struct range_const_iterator< char* >
|
||||
{
|
||||
typedef const char* type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct const_iterator_of< wchar_t* >
|
||||
struct range_const_iterator< wchar_t* >
|
||||
{
|
||||
typedef const wchar_t* type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct const_iterator_of< const char* >
|
||||
struct range_const_iterator< const char* >
|
||||
{
|
||||
typedef const char* type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct const_iterator_of< const wchar_t* >
|
||||
struct range_const_iterator< const wchar_t* >
|
||||
{
|
||||
typedef const wchar_t* type;
|
||||
};
|
||||
|
@ -26,10 +26,10 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct const_reverse_iterator_of
|
||||
struct range_const_reverse_iterator
|
||||
{
|
||||
typedef reverse_iterator<
|
||||
BOOST_DEDUCED_TYPENAME const_iterator_of<C>::type > type;
|
||||
BOOST_DEDUCED_TYPENAME range_const_iterator<C>::type > type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
@ -30,7 +30,7 @@ namespace boost
|
||||
struct range_begin<std_container_>
|
||||
{
|
||||
template< typename C >
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME result_iterator_of<C>::type fun( C& c )
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type fun( C& c )
|
||||
{
|
||||
return c.begin();
|
||||
};
|
||||
@ -44,7 +44,7 @@ namespace boost
|
||||
struct range_begin<std_pair_>
|
||||
{
|
||||
template< typename P >
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME result_iterator_of<P>::type fun( const P& p )
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<P>::type fun( const P& p )
|
||||
{
|
||||
return p.first;
|
||||
}
|
||||
@ -108,7 +108,7 @@ namespace boost
|
||||
} // namespace 'range_detail'
|
||||
|
||||
template< typename C >
|
||||
inline BOOST_DEDUCED_TYPENAME result_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_result_iterator<C>::type
|
||||
begin( C& c )
|
||||
{
|
||||
return range_detail::range_begin< BOOST_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
|
||||
|
@ -111,7 +111,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
class const_iterator_of
|
||||
class range_const_iterator
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
|
||||
public:
|
||||
|
@ -108,7 +108,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
class difference_type_of
|
||||
class range_difference
|
||||
{
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
|
||||
public:
|
||||
|
@ -30,7 +30,8 @@ namespace boost
|
||||
struct range_end<std_container_>
|
||||
{
|
||||
template< typename C >
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME result_iterator_of<C>::type fun( C& c )
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type
|
||||
fun( C& c )
|
||||
{
|
||||
return c.end();
|
||||
};
|
||||
@ -44,7 +45,8 @@ namespace boost
|
||||
struct range_end<std_pair_>
|
||||
{
|
||||
template< typename P >
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME result_iterator_of<P>::type fun( const P& p )
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<P>::type
|
||||
fun( const P& p )
|
||||
{
|
||||
return p.second;
|
||||
}
|
||||
@ -129,7 +131,7 @@ namespace boost
|
||||
} // namespace 'range_detail'
|
||||
|
||||
template< typename C >
|
||||
inline BOOST_DEDUCED_TYPENAME result_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_result_iterator<C>::type
|
||||
end( C& c )
|
||||
{
|
||||
return range_detail::range_end< BOOST_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
|
||||
|
@ -110,7 +110,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
class iterator_of
|
||||
class range_iterator
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
|
||||
public:
|
||||
|
@ -22,14 +22,14 @@ namespace boost
|
||||
namespace range_detail
|
||||
{
|
||||
template< typename T >
|
||||
struct range_size;
|
||||
struct range_size_;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// default
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_size<std_container_>
|
||||
struct range_size_<std_container_>
|
||||
{
|
||||
template< typename C >
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME C::size_type fun( const C& c )
|
||||
@ -43,10 +43,11 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_size<std_pair_>
|
||||
struct range_size_<std_pair_>
|
||||
{
|
||||
template< typename P >
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME size_type_of<P>::type fun( const P& p )
|
||||
static BOOST_RANGE_DEDUCED_TYPENAME range_size<P>::type
|
||||
fun( const P& p )
|
||||
{
|
||||
return std::distance( p.first, p.second );
|
||||
}
|
||||
@ -57,30 +58,30 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_size<array_>
|
||||
struct range_size_<array_>
|
||||
{
|
||||
template< typename T, std::size_t sz >
|
||||
static std::size_t fun( T BOOST_ARRAY_REF[sz] )
|
||||
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
|
||||
{
|
||||
return sz;
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size<char_array_>
|
||||
struct range_size_<char_array_>
|
||||
{
|
||||
template< typename T, std::size_t sz >
|
||||
static std::size_t fun( T BOOST_ARRAY_REF[sz] )
|
||||
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
|
||||
{
|
||||
return boost::range_detail::array_size( array );
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size<wchar_t_array_>
|
||||
struct range_size_<wchar_t_array_>
|
||||
{
|
||||
template< typename T, std::size_t sz >
|
||||
static std::size_t fun( T BOOST_ARRAY_REF[sz] )
|
||||
static std::size_t fun( T BOOST_RANGE_ARRAY_REF()[sz] )
|
||||
{
|
||||
return boost::range_detail::array_size( array );
|
||||
}
|
||||
@ -91,7 +92,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct range_size<char_ptr_>
|
||||
struct range_size_<char_ptr_>
|
||||
{
|
||||
static std::size_t fun( const char* s )
|
||||
{
|
||||
@ -100,7 +101,7 @@ namespace boost
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size<const_char_ptr_>
|
||||
struct range_size_<const_char_ptr_>
|
||||
{
|
||||
static std::size_t fun( const char* s )
|
||||
{
|
||||
@ -109,7 +110,7 @@ namespace boost
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size<wchar_t_ptr_>
|
||||
struct range_size_<wchar_t_ptr_>
|
||||
{
|
||||
static std::size_t fun( const wchar_t* s )
|
||||
{
|
||||
@ -118,7 +119,7 @@ namespace boost
|
||||
};
|
||||
|
||||
template<>
|
||||
struct range_size<const_wchar_t_ptr_>
|
||||
struct range_size_<const_wchar_t_ptr_>
|
||||
{
|
||||
static std::size_t fun( const wchar_t* s )
|
||||
{
|
||||
@ -130,10 +131,10 @@ namespace boost
|
||||
|
||||
|
||||
template< typename C >
|
||||
BOOST_RANGE_DEDUCED_TYPENAME size_type_of<C>::type
|
||||
BOOST_RANGE_DEDUCED_TYPENAME range_size<C>::type
|
||||
size( const C& c )
|
||||
{
|
||||
return range_detail::range_size< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
|
||||
return range_detail::range_size_< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
|
||||
}
|
||||
|
||||
} // namespace 'boost'
|
||||
|
@ -103,11 +103,10 @@ namespace boost
|
||||
typedef std::size_t type;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
class size_type_of
|
||||
class range_size
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
|
||||
public:
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define BOOST_RANGE_DETAIL_VALUE_TYPE_HPP
|
||||
|
||||
#include <boost/range/detail/common.hpp>
|
||||
#include <boost/type_traits/remove_bounds.hpp>
|
||||
#include <boost/iterator/iterator_traits.hpp>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
@ -51,7 +52,7 @@ namespace boost
|
||||
template< typename T >
|
||||
struct pts
|
||||
{
|
||||
typedef void /*dummy*/ type;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::remove_bounds<T>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
@ -108,7 +109,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
class value_type_of
|
||||
class range_value
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
|
||||
public:
|
||||
|
@ -32,7 +32,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct difference_type_of
|
||||
struct range_difference
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME C::difference_type type;
|
||||
};
|
||||
@ -42,14 +42,14 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct difference_type_of< std::pair<Iterator,Iterator> >
|
||||
struct range_difference< std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
iterator_difference<Iterator>::type type;
|
||||
};
|
||||
|
||||
template< typename Iterator >
|
||||
struct difference_type_of< const std::pair<Iterator,Iterator> >
|
||||
struct range_difference< const std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
iterator_difference<Iterator>::type type;
|
||||
@ -61,13 +61,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct difference_type_of< T[sz] >
|
||||
struct range_difference< T[sz] >
|
||||
{
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct difference_type_of< const T[sz] >
|
||||
struct range_difference< const T[sz] >
|
||||
{
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
@ -77,25 +77,25 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct difference_type_of< char* >
|
||||
struct range_difference< char* >
|
||||
{
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct difference_type_of< wchar_t* >
|
||||
struct range_difference< wchar_t* >
|
||||
{
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct difference_type_of< const char* >
|
||||
struct range_difference< const char* >
|
||||
{
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct difference_type_of< const wchar_t* >
|
||||
struct range_difference< const wchar_t* >
|
||||
{
|
||||
typedef std::ptrdiff_t type;
|
||||
};
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
namespace range_detail
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -52,16 +52,16 @@ namespace range
|
||||
return s == 0 || s[0] == 0;
|
||||
}
|
||||
|
||||
} // namespace 'range'
|
||||
} // namespace 'range_detail'
|
||||
|
||||
template< class T >
|
||||
inline bool empty( const T& r )
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
using range::empty;
|
||||
using range_detail::empty;
|
||||
return empty( r );
|
||||
#else
|
||||
return range::empty( r );
|
||||
return range_detail::empty( r );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
namespace range_detail
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -35,14 +35,14 @@ namespace range
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
inline BOOST_DEDUCED_TYPENAME const_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_const_iterator<C>::type
|
||||
end( const C& c )
|
||||
{
|
||||
return c.end();
|
||||
}
|
||||
|
||||
template< typename C >
|
||||
inline BOOST_DEDUCED_TYPENAME iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
|
||||
end( C& c )
|
||||
{
|
||||
return c.end();
|
||||
@ -104,27 +104,27 @@ namespace range
|
||||
return range_detail::str_end( s );
|
||||
}
|
||||
|
||||
} // namespace 'range'
|
||||
} // namespace 'range_detail'
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME iterator_of<T>::type end( T& r )
|
||||
inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
using range::end;
|
||||
using range_detail::end;
|
||||
return end( r );
|
||||
#else
|
||||
return range::end( r );
|
||||
return range_detail::end( r );
|
||||
#endif
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME const_iterator_of<T>::type end( const T& r )
|
||||
inline BOOST_DEDUCED_TYPENAME range_const_iterator<T>::type end( const T& r )
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
using range::end;
|
||||
using range_detail::end;
|
||||
return end( r );
|
||||
#else
|
||||
return range::end( r );
|
||||
return range_detail::end( r );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct iterator_of
|
||||
struct range_iterator
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME C::iterator type;
|
||||
};
|
||||
@ -42,13 +42,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct iterator_of< std::pair<Iterator,Iterator> >
|
||||
struct range_iterator< std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef Iterator type;
|
||||
};
|
||||
|
||||
template< typename Iterator >
|
||||
struct iterator_of< const std::pair<Iterator,Iterator> >
|
||||
struct range_iterator< const std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef Iterator type;
|
||||
};
|
||||
@ -58,13 +58,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct iterator_of< T[sz] >
|
||||
struct range_iterator< T[sz] >
|
||||
{
|
||||
typedef T* type;
|
||||
};
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct iterator_of< const T[sz] >
|
||||
struct range_iterator< const T[sz] >
|
||||
{
|
||||
typedef const T* type;
|
||||
};
|
||||
@ -74,25 +74,25 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct iterator_of< char* >
|
||||
struct range_iterator< char* >
|
||||
{
|
||||
typedef char* type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct iterator_of< wchar_t* >
|
||||
struct range_iterator< wchar_t* >
|
||||
{
|
||||
typedef wchar_t* type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct iterator_of< const char* >
|
||||
struct range_iterator< const char* >
|
||||
{
|
||||
typedef const char* type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct iterator_of< const wchar_t* >
|
||||
struct range_iterator< const wchar_t* >
|
||||
{
|
||||
typedef const wchar_t* type;
|
||||
};
|
||||
|
@ -221,10 +221,10 @@ namespace boost {
|
||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
template< typename Range >
|
||||
inline iterator_range< BOOST_DEDUCED_TYPENAME result_iterator_of<Range>::type >
|
||||
inline iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type >
|
||||
make_iterator_range( Range& r )
|
||||
{
|
||||
return iterator_range< BOOST_DEDUCED_TYPENAME result_iterator_of<Range>::type >
|
||||
return iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<Range>::type >
|
||||
( begin( r ), end( r ) );
|
||||
}
|
||||
|
||||
@ -235,18 +235,18 @@ namespace boost {
|
||||
and end iterators.
|
||||
*/
|
||||
template< class ForwardRange >
|
||||
inline iterator_range< BOOST_DEDUCED_TYPENAME iterator_of<ForwardRange>::type >
|
||||
inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type >
|
||||
make_iterator_range( ForwardRange& r )
|
||||
{
|
||||
return iterator_range< BOOST_DEDUCED_TYPENAME iterator_of<ForwardRange>::type >
|
||||
return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type >
|
||||
( r );
|
||||
}
|
||||
|
||||
template< class ForwardRange >
|
||||
inline iterator_range< BOOST_DEDUCED_TYPENAME const_iterator_of<ForwardRange>::type >
|
||||
inline iterator_range< BOOST_DEDUCED_TYPENAME range_const_iterator<ForwardRange>::type >
|
||||
make_iterator_range( const ForwardRange& r )
|
||||
{
|
||||
return iterator_range< BOOST_DEDUCED_TYPENAME const_iterator_of<ForwardRange>::type >
|
||||
return iterator_range< BOOST_DEDUCED_TYPENAME range_const_iterator<ForwardRange>::type >
|
||||
( r );
|
||||
}
|
||||
#endif
|
||||
|
@ -26,26 +26,26 @@ namespace boost
|
||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
template< class C >
|
||||
inline BOOST_DEDUCED_TYPENAME reverse_result_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
|
||||
rbegin( C& c )
|
||||
{
|
||||
return BOOST_DEDUCED_TYPENAME reverse_result_iterator_of<C>::type( end( c ) );
|
||||
return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type( end( c ) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
template< class C >
|
||||
inline BOOST_DEDUCED_TYPENAME reverse_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
|
||||
rbegin( C& c )
|
||||
{
|
||||
return BOOST_DEDUCED_TYPENAME reverse_iterator_of<C>::type( end( c ) );
|
||||
return BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type( end( c ) );
|
||||
}
|
||||
|
||||
template< class C >
|
||||
inline BOOST_DEDUCED_TYPENAME const_reverse_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
|
||||
rbegin( const C& c )
|
||||
{
|
||||
return BOOST_DEDUCED_TYPENAME const_reverse_iterator_of<C>::type( end( c ) );
|
||||
return BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type( end( c ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -26,26 +26,26 @@ namespace boost
|
||||
#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
template< class C >
|
||||
inline BOOST_DEDUCED_TYPENAME reverse_result_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type
|
||||
rend( C& c )
|
||||
{
|
||||
return BOOST_DEDUCED_TYPENAME reverse_result_iterator_of<C>::type( begin( c ) );
|
||||
return BOOST_DEDUCED_TYPENAME range_reverse_result_iterator<C>::type( begin( c ) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
template< class C >
|
||||
inline BOOST_DEDUCED_TYPENAME reverse_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
|
||||
rend( C& c )
|
||||
{
|
||||
return BOOST_DEDUCED_TYPENAME reverse_iterator_of<C>::type( begin( c ) );
|
||||
return BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type( begin( c ) );
|
||||
}
|
||||
|
||||
template< class C >
|
||||
inline BOOST_DEDUCED_TYPENAME const_reverse_iterator_of<C>::type
|
||||
inline BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type
|
||||
rend( const C& c )
|
||||
{
|
||||
return BOOST_DEDUCED_TYPENAME const_reverse_iterator_of<C>::type( begin( c ) );
|
||||
return BOOST_DEDUCED_TYPENAME range_const_reverse_iterator<C>::type( begin( c ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -28,12 +28,12 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct result_iterator_of
|
||||
struct range_result_iterator
|
||||
{
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
mpl::if_< BOOST_DEDUCED_TYPENAME is_const<C>::type,
|
||||
BOOST_DEDUCED_TYPENAME const_iterator_of<C>::type,
|
||||
BOOST_DEDUCED_TYPENAME iterator_of<C>::type >::type type;
|
||||
BOOST_DEDUCED_TYPENAME range_const_iterator<C>::type,
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<C>::type >::type type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
@ -27,10 +27,10 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct reverse_iterator_of
|
||||
struct range_reverse_iterator
|
||||
{
|
||||
typedef reverse_iterator<
|
||||
BOOST_DEDUCED_TYPENAME iterator_of<C>::type > type;
|
||||
BOOST_DEDUCED_TYPENAME range_iterator<C>::type > type;
|
||||
};
|
||||
|
||||
|
||||
|
@ -26,10 +26,10 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct reverse_result_iterator_of
|
||||
struct range_reverse_result_iterator
|
||||
{
|
||||
typedef reverse_iterator<
|
||||
BOOST_DEDUCED_TYPENAME result_iterator_of<C>::type > type;
|
||||
BOOST_DEDUCED_TYPENAME range_result_iterator<C>::type > type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace range
|
||||
namespace range_detail
|
||||
{
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -86,13 +86,13 @@ namespace range
|
||||
} // namespace 'range'
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME size_type_of<T>::type size( const T& r )
|
||||
inline BOOST_DEDUCED_TYPENAME range_size<T>::type size( const T& r )
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
using range::size;
|
||||
using range_detail::size;
|
||||
return size( r );
|
||||
#else
|
||||
return range::size( r );
|
||||
return range_detail::size( r );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct size_type_of
|
||||
struct range_size
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME C::size_type type;
|
||||
};
|
||||
@ -41,13 +41,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct size_type_of< std::pair<Iterator,Iterator> >
|
||||
struct range_size< std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
||||
template< typename Iterator >
|
||||
struct size_type_of< const std::pair<Iterator,Iterator> >
|
||||
struct range_size< const std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
@ -57,13 +57,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct size_type_of< T[sz] >
|
||||
struct range_size< T[sz] >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct size_type_of< const T[sz] >
|
||||
struct range_size< const T[sz] >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
@ -73,25 +73,25 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct size_type_of< char* >
|
||||
struct range_size< char* >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct size_type_of< wchar_t* >
|
||||
struct range_size< wchar_t* >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct size_type_of< const char* >
|
||||
struct range_size< const char* >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct size_type_of< const wchar_t* >
|
||||
struct range_size< const wchar_t* >
|
||||
{
|
||||
typedef std::size_t type;
|
||||
};
|
||||
|
@ -22,17 +22,17 @@ namespace boost
|
||||
{
|
||||
|
||||
template< class ForwardRange >
|
||||
class sub_range : public iterator_range< BOOST_DEDUCED_TYPENAME result_iterator_of<ForwardRange>::type >
|
||||
class sub_range : public iterator_range< BOOST_DEDUCED_TYPENAME range_result_iterator<ForwardRange>::type >
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME result_iterator_of<ForwardRange>::type iterator_t;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_result_iterator<ForwardRange>::type iterator_t;
|
||||
typedef iterator_range< iterator_t > base;
|
||||
|
||||
public:
|
||||
typedef BOOST_DEDUCED_TYPENAME value_type_of<ForwardRange>::type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME result_iterator_of<ForwardRange>::type iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME const_iterator_of<ForwardRange>::type const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME difference_type_of<ForwardRange>::type difference_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME size_type_of<ForwardRange>::type size_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_value<ForwardRange>::type value_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_result_iterator<ForwardRange>::type iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_const_iterator<ForwardRange>::type const_iterator;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_difference<ForwardRange>::type difference_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME range_size<ForwardRange>::type size_type;
|
||||
|
||||
public:
|
||||
template< class ForwardRange2 >
|
||||
|
@ -33,7 +33,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename C >
|
||||
struct value_type_of
|
||||
struct range_value
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME C::value_type type;
|
||||
};
|
||||
@ -43,7 +43,7 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename Iterator >
|
||||
struct value_type_of< std::pair<Iterator,Iterator> >
|
||||
struct range_value< std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
iterator_value<Iterator>::type type;
|
||||
@ -51,7 +51,7 @@ namespace boost
|
||||
|
||||
|
||||
template< typename Iterator >
|
||||
struct value_type_of< const std::pair<Iterator,Iterator> >
|
||||
struct range_value< const std::pair<Iterator,Iterator> >
|
||||
{
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
iterator_value<Iterator>::type type;
|
||||
@ -62,13 +62,13 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct value_type_of< T[sz] >
|
||||
struct range_value< T[sz] >
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template< typename T, std::size_t sz >
|
||||
struct value_type_of< const T[sz] >
|
||||
struct range_value< const T[sz] >
|
||||
{
|
||||
typedef const T type;
|
||||
};
|
||||
@ -78,25 +78,25 @@ namespace boost
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template<>
|
||||
struct value_type_of< char* >
|
||||
struct range_value< char* >
|
||||
{
|
||||
typedef char type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct value_type_of< wchar_t* >
|
||||
struct range_value< wchar_t* >
|
||||
{
|
||||
typedef wchar_t type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct value_type_of< const char* >
|
||||
struct range_value< const char* >
|
||||
{
|
||||
typedef const char type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct value_type_of< const wchar_t* >
|
||||
struct range_value< const wchar_t* >
|
||||
{
|
||||
typedef const wchar_t type;
|
||||
};
|
||||
|
@ -82,7 +82,7 @@ test-suite range
|
||||
: adl_conformance
|
||||
]
|
||||
[ run
|
||||
adl_conformance_no_using_declaration.cpp
|
||||
adl_conformance_no_using.cpp
|
||||
: :
|
||||
:
|
||||
: adl_conformance_no_using_declaration
|
||||
|
@ -30,14 +30,14 @@ namespace
|
||||
// example: extrating bounds in a generic algorithm
|
||||
//
|
||||
template< typename Range, typename T >
|
||||
inline typename boost::iterator_of<Range>::type
|
||||
inline typename boost::range_iterator<Range>::type
|
||||
find( Range& c, const T& value )
|
||||
{
|
||||
return std::find( boost::begin( c ), boost::end( c ), value );
|
||||
}
|
||||
|
||||
template< typename Range, typename T >
|
||||
inline typename boost::const_iterator_of<Range>::type
|
||||
inline typename boost::range_const_iterator<Range>::type
|
||||
find( const Range& c, const T& value )
|
||||
{
|
||||
return std::find( boost::begin( c ), boost::end( c ), value );
|
||||
@ -47,10 +47,10 @@ namespace
|
||||
// replace first value and return its index
|
||||
//
|
||||
template< class Range, class T >
|
||||
inline typename boost::size_type_of< Range >::type
|
||||
inline typename boost::range_size<Range>::type
|
||||
my_generic_replace( Range& c, const T& value, const T& replacement )
|
||||
{
|
||||
typename boost::iterator_of<Range>::type found = find( c, value );
|
||||
typename boost::range_iterator<Range>::type found = find( c, value );
|
||||
|
||||
if( found != boost::end( c ) )
|
||||
*found = replacement;
|
||||
|
@ -42,21 +42,21 @@ void check_array()
|
||||
// BOOST_RANGE_NO_STATIC_ASSERT
|
||||
#if !defined( __BORLANDC__ ) || ( _MSC_VER <= 1200 )
|
||||
#else
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<int[10]>::type, int >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<int[10]>::type, int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<int[10]>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<int[10]>::type, std::ptrdiff_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<int[10]>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<int[10]>::type, int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const int[10]>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<array_t>::type, int >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<array_t>::type, int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<array_t>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<array_t>::type, std::ptrdiff_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<array_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<array_t>::type, int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const array_t>::type, const int* >::value ));
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<const int[10]>::type, const int >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<const int[10]>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<const int[10]>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<const int[10]>::type, std::ptrdiff_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<const int[10]>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const int[10]>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const int[10]>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<const array_t>::type, const int >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<const array_t>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<const array_t>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<const array_t>::type, std::ptrdiff_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<const array_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const array_t>::type, const int* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const array_t>::type, const int* >::value ));
|
||||
#endif
|
||||
|
||||
BOOST_CHECK_EQUAL( begin( my_array ), my_array );
|
||||
|
@ -41,25 +41,25 @@ void check_iterator_pair()
|
||||
const_pair_tt constness_pair( pair );
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<pair_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<pair_t>::type,
|
||||
detail::iterator_traits<pair_t::first_type>::value_type>::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<pair_t>::type, pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<pair_t>::type, pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<pair_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<pair_t>::type, pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<pair_t>::type, pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<pair_t>::type,
|
||||
detail::iterator_traits<pair_t::first_type>::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<pair_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<pair_t>::type, pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const_pair_t>::type, const_pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<pair_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<pair_t>::type, pair_t::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const_pair_t>::type, const_pair_t::first_type >::value ));
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<const_pair_tt>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<const_pair_tt>::type,
|
||||
detail::iterator_traits<const_pair_t::first_type>::value_type>::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<const_pair_tt>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<const_pair_tt>::type,
|
||||
detail::iterator_traits<const_pair_tt::first_type>::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<const_pair_tt>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<const_pair_tt>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const_pair_tt>::type, const_pair_tt::first_type >::value ));
|
||||
|
||||
BOOST_CHECK( begin( pair ) == pair.first );
|
||||
BOOST_CHECK( end( pair ) == pair.second );
|
||||
|
@ -35,7 +35,7 @@ void check_iterator()
|
||||
typedef vector<char> vec_t;
|
||||
typedef vec_t::iterator iterator;
|
||||
typedef pair<iterator,iterator> pair_t;
|
||||
typedef reverse_iterator_of<pair_t>::type rev_iterator;
|
||||
typedef range_reverse_iterator<pair_t>::type rev_iterator;
|
||||
typedef pair<rev_iterator,rev_iterator> rev_pair_t;
|
||||
|
||||
vec_t vec;
|
||||
@ -50,8 +50,8 @@ void check_iterator()
|
||||
wchar_t wa[] = L"mutable";
|
||||
const wchar_t cwa[]= L"not mutable";
|
||||
|
||||
BOOST_CHECK( rbegin( vec ) == reverse_iterator_of<vec_t>::type( vec.end() ) );
|
||||
BOOST_CHECK( rend( vec ) == reverse_iterator_of<vec_t>::type( vec.begin() ) );
|
||||
BOOST_CHECK( rbegin( vec ) == range_reverse_iterator<vec_t>::type( vec.end() ) );
|
||||
BOOST_CHECK( rend( vec ) == range_reverse_iterator<vec_t>::type( vec.begin() ) );
|
||||
BOOST_CHECK( distance( rbegin( vec ), rend( vec ) ) == distance( begin( vec ), end( vec ) ) );
|
||||
|
||||
BOOST_CHECK( rbegin( p ) == begin( rp ) );
|
||||
|
@ -34,19 +34,19 @@ void check_std_container()
|
||||
vec.push_back( 3 ); vec.push_back( 4 );
|
||||
const vec_t cvec( vec );
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<vec_t>::type, vec_t::value_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<vec_t>::type, vec_t::iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<vec_t>::type, vec_t::const_iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<vec_t>::type, vec_t::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<vec_t>::type, vec_t::size_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<vec_t>::type, vec_t::iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const vec_t>::type, vec_t::const_iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<vec_t>::type, vec_t::value_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<vec_t>::type, vec_t::iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<vec_t>::type, vec_t::const_iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<vec_t>::type, vec_t::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<vec_t>::type, vec_t::size_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<vec_t>::type, vec_t::iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const vec_t>::type, vec_t::const_iterator >::value ));
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<const vec_t>::type, vec_t::value_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<const vec_t>::type, vec_t::iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<const vec_t>::type, vec_t::const_iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<const vec_t>::type, vec_t::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<const vec_t>::type, vec_t::size_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<const vec_t>::type, vec_t::value_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<const vec_t>::type, vec_t::iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<const vec_t>::type, vec_t::const_iterator >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<const vec_t>::type, vec_t::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<const vec_t>::type, vec_t::size_type >::value ));
|
||||
|
||||
BOOST_CHECK( begin( vec ) == vec.begin() );
|
||||
BOOST_CHECK( end( vec ) == vec.end() );
|
||||
|
@ -28,14 +28,14 @@
|
||||
#include <algorithm>
|
||||
|
||||
template< typename Container, typename T >
|
||||
BOOST_DEDUCED_TYPENAME boost::iterator_of<Container>::type
|
||||
BOOST_DEDUCED_TYPENAME boost::range_iterator<Container>::type
|
||||
find( Container& c, T value )
|
||||
{
|
||||
return std::find( boost::begin( c ), boost::end( c ), value );
|
||||
}
|
||||
|
||||
template< typename Container, typename T >
|
||||
BOOST_DEDUCED_TYPENAME boost::const_iterator_of<Container>::type
|
||||
BOOST_DEDUCED_TYPENAME boost::range_const_iterator<Container>::type
|
||||
find( const Container& c, T value )
|
||||
{
|
||||
return std::find( boost::begin( c ), boost::end( c ), value );
|
||||
@ -59,28 +59,28 @@ void check_char()
|
||||
const unsigned my_string_length = 14;
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<char_iterator_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<char_iterator_t>::type,
|
||||
detail::iterator_traits<char_iterator_t>::value_type>::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<char_iterator_t>::type, char_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<char_iterator_t>::type, const char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<char_iterator_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<char_iterator_t>::type, char_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<char_iterator_t>::type, const char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<char_iterator_t>::type,
|
||||
::std::ptrdiff_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<char_iterator_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<char_iterator_t>::type, char_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const char*>::type, const char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<char_iterator_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<char_iterator_t>::type, char_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const char*>::type, const char* >::value ));
|
||||
//
|
||||
// note: why does is_same< result_iterator<const char_iterator_t>::type, const char* >::value
|
||||
// fail?!?
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<char_array_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<char_array_t>::type,
|
||||
char>::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<char[10]>::type, char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<char[10]>::type, const char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<char_array_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<char[10]>::type, char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<char[10]>::type, const char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<char_array_t>::type,
|
||||
::std::ptrdiff_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<char_array_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<char[10]>::type, char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const char[10]>::type, const char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<char_array_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<char[10]>::type, char* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const char[10]>::type, const char* >::value ));
|
||||
|
||||
BOOST_CHECK_EQUAL( begin( char_s ), char_s );
|
||||
std::size_t sz = size( char_s );
|
||||
@ -90,8 +90,8 @@ void check_char()
|
||||
BOOST_CHECK_EQUAL( sz, std::char_traits<char>::length( char_s ) );
|
||||
|
||||
BOOST_CHECK_EQUAL( begin( my_string ), my_string );
|
||||
iterator_of<char[15]>::type end2 = begin( my_string ) + size( my_string );
|
||||
iterator_of<char[15]>::type end3 = end( my_string );
|
||||
range_iterator<char[15]>::type end2 = begin( my_string ) + size( my_string );
|
||||
range_iterator<char[15]>::type end3 = end( my_string );
|
||||
BOOST_CHECK_EQUAL( end3, end2 );
|
||||
BOOST_CHECK_EQUAL( empty( my_string ), (my_string == 0 || my_string[0] == char()) );
|
||||
BOOST_CHECK_EQUAL( size( my_string ), my_string_length );
|
||||
@ -118,15 +118,15 @@ void check_string()
|
||||
const wchar_t* char_ws = L"a wide string";
|
||||
wchar_t my_wstring[] = L"another wide string";
|
||||
|
||||
BOOST_STATIC_ASSERT(( is_same< value_type_of<wchar_iterator_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_value<wchar_iterator_t>::type,
|
||||
detail::iterator_traits<wchar_iterator_t>::value_type>::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< iterator_of<wchar_iterator_t>::type, wchar_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< const_iterator_of<wchar_iterator_t>::type, const wchar_t* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< difference_type_of<wchar_iterator_t>::type,
|
||||
BOOST_STATIC_ASSERT(( is_same< range_iterator<wchar_iterator_t>::type, wchar_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_const_iterator<wchar_iterator_t>::type, const wchar_t* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_difference<wchar_iterator_t>::type,
|
||||
detail::iterator_traits<wchar_iterator_t>::difference_type >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< size_type_of<wchar_iterator_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<wchar_iterator_t>::type, wchar_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< result_iterator_of<const wchar_t*>::type, const wchar_t* >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_size<wchar_iterator_t>::type, std::size_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<wchar_iterator_t>::type, wchar_iterator_t >::value ));
|
||||
BOOST_STATIC_ASSERT(( is_same< range_result_iterator<const wchar_t*>::type, const wchar_t* >::value ));
|
||||
|
||||
std::size_t sz = size( char_ws );
|
||||
BOOST_CHECK_EQUAL( begin( char_ws ), char_ws );
|
||||
|
Reference in New Issue
Block a user