mirror of
https://github.com/boostorg/range.git
synced 2025-07-01 23:11:06 +02:00
Compare commits
12 Commits
boost-1.48
...
svn-branch
Author | SHA1 | Date | |
---|---|---|---|
d46a4468e1 | |||
1cb6a99c80 | |||
c4bd4bf4ce | |||
41b76f8f5c | |||
846f11a96c | |||
8810c4c4aa | |||
91428c2110 | |||
44c26a3356 | |||
b06fca8378 | |||
3b3889b70f | |||
5ed6116490 | |||
df1a3a334f |
@ -15,7 +15,7 @@
|
||||
# pragma once
|
||||
#endif
|
||||
|
||||
#if _MSC_VER == 1300 // experiment
|
||||
#if defined(_MSC_VER) && (_MSC_VER == 1300)
|
||||
|
||||
#include <boost/range/detail/collection_traits.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
@ -28,6 +28,6 @@
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
#include <boost/range/sub_range.hpp>
|
||||
|
||||
#endif // _MSC_VER == 1300 // experiment
|
||||
#endif // _MSC_VER == 1300
|
||||
|
||||
#endif
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <cstring>
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#include <cwchar>
|
||||
#endif
|
||||
|
||||
@ -38,41 +38,41 @@ namespace boost
|
||||
return strlen( s );
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
inline std::size_t length( const wchar_t* s )
|
||||
{
|
||||
return wcslen( s );
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Remark: the compiler cannot choose between T* and T[sz]
|
||||
// overloads, so we must put the T* internal to the
|
||||
// unconstrained version.
|
||||
//
|
||||
//
|
||||
|
||||
inline bool is_char_ptr( char* )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
inline bool is_char_ptr( const char* )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
inline bool is_char_ptr( wchar_t* )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
inline bool is_char_ptr( const wchar_t* )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
template< class T >
|
||||
inline long is_char_ptr( T /* r */ )
|
||||
{
|
||||
@ -80,30 +80,30 @@ namespace boost
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline iterator_range<T*>
|
||||
inline iterator_range<T*>
|
||||
make_range( T* const r, bool )
|
||||
{
|
||||
return iterator_range<T*>( r, r + length(r) );
|
||||
}
|
||||
|
||||
template< class T >
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<T>::type>
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<T>::type>
|
||||
make_range( T& r, long )
|
||||
{
|
||||
return boost::make_iterator_range( r );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
template< class Range >
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<Range>::type>
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<Range>::type>
|
||||
as_literal( Range& r )
|
||||
{
|
||||
return range_detail::make_range( r, range_detail::is_char_ptr(r) );
|
||||
}
|
||||
|
||||
template< class Range >
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type>
|
||||
inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type>
|
||||
as_literal( const Range& r )
|
||||
{
|
||||
return range_detail::make_range( r, range_detail::is_char_ptr(r) );
|
||||
@ -112,9 +112,9 @@ namespace boost
|
||||
template< class Char, std::size_t sz >
|
||||
inline iterator_range<Char*> as_literal( Char (&arr)[sz] )
|
||||
{
|
||||
return range_detail::make_range( arr, range_detail::is_char_ptr(arr) );
|
||||
return range_detail::make_range( arr, range_detail::is_char_ptr(arr) );
|
||||
}
|
||||
|
||||
|
||||
template< class Char, std::size_t sz >
|
||||
inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
|
||||
{
|
||||
|
@ -21,13 +21,13 @@
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
namespace boost
|
||||
{
|
||||
namespace range_detail
|
||||
{
|
||||
template <typename T>
|
||||
inline void boost_range_silence_warning( const T& ) { }
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// end() help
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
@ -36,7 +36,7 @@ namespace boost
|
||||
{
|
||||
return s + strlen( s );
|
||||
}
|
||||
|
||||
|
||||
#ifndef BOOST_NO_CWCHAR
|
||||
inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
|
||||
{
|
||||
@ -51,7 +51,7 @@ namespace boost
|
||||
;
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
template< class Char >
|
||||
inline Char* str_end( Char* s )
|
||||
@ -64,7 +64,7 @@ namespace boost
|
||||
{
|
||||
return boost_range_array + sz;
|
||||
}
|
||||
|
||||
|
||||
template< class T, std::size_t sz >
|
||||
inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz] )
|
||||
{
|
||||
@ -74,7 +74,7 @@ namespace boost
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// size() help
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
template< class Char >
|
||||
inline std::size_t str_size( const Char* const& s )
|
||||
{
|
||||
@ -96,7 +96,7 @@ namespace boost
|
||||
}
|
||||
|
||||
} // namespace 'range_detail'
|
||||
|
||||
|
||||
} // namespace 'boost'
|
||||
|
||||
|
||||
|
@ -25,46 +25,46 @@
|
||||
namespace boost
|
||||
{
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
|
||||
namespace range_detail_vc7_1
|
||||
{
|
||||
template< typename C, typename Sig = void(C) >
|
||||
struct range_iterator
|
||||
{
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
mpl::eval_if_c< is_const<C>::value,
|
||||
range_const_iterator< typename remove_const<C>::type >,
|
||||
range_mutable_iterator<C> >::type type;
|
||||
};
|
||||
|
||||
template< typename C, typename T >
|
||||
struct range_iterator< C, void(T[]) >
|
||||
{
|
||||
typedef T* type;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
namespace range_detail_vc7_1
|
||||
{
|
||||
template< typename C, typename Sig = void(C) >
|
||||
struct range_iterator
|
||||
{
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
mpl::eval_if_c< is_const<C>::value,
|
||||
range_const_iterator< typename remove_const<C>::type >,
|
||||
range_mutable_iterator<C> >::type type;
|
||||
};
|
||||
|
||||
template< typename C, typename T >
|
||||
struct range_iterator< C, void(T[]) >
|
||||
{
|
||||
typedef T* type;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
template< typename C >
|
||||
struct range_iterator
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
range_detail_vc7_1::range_iterator<C>::type type;
|
||||
|
||||
#else
|
||||
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
range_detail_vc7_1::range_iterator<C>::type type;
|
||||
|
||||
#else
|
||||
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
mpl::eval_if_c< is_const<C>::value,
|
||||
typedef BOOST_RANGE_DEDUCED_TYPENAME
|
||||
mpl::eval_if_c< is_const<C>::value,
|
||||
range_const_iterator< typename remove_const<C>::type >,
|
||||
range_mutable_iterator<C> >::type type;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
//#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
@ -172,9 +172,9 @@ void check_adl_conformance()
|
||||
BOOST_CHECK_EQUAL( boost_test::begin( r6 ), global_namespace );
|
||||
}
|
||||
|
||||
#include <boost/test/included/unit_test_framework.hpp>
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
using boost::unit_test_framework::test_suite;
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <boost/range/begin.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <boost/test/included/unit_test_framework.hpp>
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
namespace mock_std
|
||||
{
|
||||
@ -104,12 +104,12 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
using boost::unit_test_framework::test_suite;
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
boost::unit_test_framework::test_suite*
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
boost::unit_test_framework::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite - begin() ADL namespace barrier" );
|
||||
boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite - begin() ADL namespace barrier" );
|
||||
|
||||
test->add( BOOST_TEST_CASE( &test_range_begin ) );
|
||||
|
||||
|
@ -53,9 +53,9 @@ void compat1()
|
||||
iterator_of< std::vector<int> >::type i = v.begin();
|
||||
}
|
||||
|
||||
#include <boost/test/included/unit_test_framework.hpp>
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
using boost::unit_test_framework::test_suite;
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
|
@ -53,9 +53,9 @@ void compat1()
|
||||
iterator_of< std::vector<int> >::type i = v.begin();
|
||||
}
|
||||
|
||||
#include <boost/test/included/unit_test_framework.hpp>
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
using boost::unit_test_framework::test_suite;
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
test_suite* init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <boost/range/end.hpp>
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
#include <boost/test/included/unit_test_framework.hpp>
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
|
||||
namespace mock_std
|
||||
{
|
||||
@ -104,12 +104,12 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
using boost::unit_test_framework::test_suite;
|
||||
using boost::unit_test::test_suite;
|
||||
|
||||
boost::unit_test_framework::test_suite*
|
||||
boost::unit_test::test_suite*
|
||||
init_unit_test_suite( int argc, char* argv[] )
|
||||
{
|
||||
boost::unit_test_framework::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite - end() ADL namespace barrier" );
|
||||
boost::unit_test::test_suite* test = BOOST_TEST_SUITE( "Range Test Suite - end() ADL namespace barrier" );
|
||||
|
||||
test->add( BOOST_TEST_CASE( &test_range_end_adl_avoidance ) );
|
||||
|
||||
|
Reference in New Issue
Block a user