forked from boostorg/range
Compare commits
4 Commits
svn-branch
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
d97760f52d | |||
29910196eb | |||
5d085424e8 | |||
6641f6a542 |
@ -21,6 +21,9 @@
|
||||
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <boost/range/detail/str_types.hpp>
|
||||
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <cstring>
|
||||
#include <cwchar>
|
||||
|
||||
@ -66,7 +69,7 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline long is_char_ptr( T r )
|
||||
inline long is_char_ptr( T /* r */ )
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
@ -104,15 +107,23 @@ namespace boost
|
||||
template< class Char, std::size_t sz >
|
||||
inline iterator_range<Char*> as_literal( Char (&arr)[sz] )
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
|
||||
return boost::make_iterator_range<Char*>( arr, arr + sz - 1 );
|
||||
#else
|
||||
return boost::make_iterator_range( arr, arr + sz - 1 );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
template< class Char, std::size_t sz >
|
||||
inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
|
||||
inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) && __BORLANDC__ >= 0x590
|
||||
return boost::make_iterator_range<const Char*>( arr, arr + sz - 1 );
|
||||
#else
|
||||
return boost::make_iterator_range( arr, arr + sz - 1 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
@ -33,28 +33,28 @@ template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME boost::range_iterator<T>::type
|
||||
str_begin( T& r )
|
||||
{
|
||||
return boost::begin( as_literal(r) );
|
||||
return boost::begin( boost::as_literal(r) );
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME boost::range_iterator<T>::type
|
||||
str_end( T& r )
|
||||
{
|
||||
return boost::end( as_literal(r) );
|
||||
return boost::end( boost::as_literal(r) );
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline BOOST_DEDUCED_TYPENAME boost::range_size<T>::type
|
||||
str_size( const T& r )
|
||||
{
|
||||
return boost::size( as_literal(r) );
|
||||
return boost::size( boost::as_literal(r) );
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline bool
|
||||
str_empty( T& r )
|
||||
{
|
||||
return boost::empty( as_literal(r) );
|
||||
return boost::empty( boost::as_literal(r) );
|
||||
}
|
||||
|
||||
template< typename Container, typename T >
|
||||
|
Reference in New Issue
Block a user