mirror of
https://github.com/boostorg/range.git
synced 2025-08-02 06:15:22 +02:00
Merge pull request #29 from ericniebler/develop
fix build break on msvc-8.0
This commit is contained in:
@@ -26,17 +26,12 @@ namespace boost
|
|||||||
{
|
{
|
||||||
namespace range_detail
|
namespace range_detail
|
||||||
{
|
{
|
||||||
template< class T, class Enabler=void >
|
template< class T, bool B = has_type<range_iterator<T> >::value >
|
||||||
struct range_difference
|
struct range_difference
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
struct range_difference<
|
struct range_difference<T, true>
|
||||||
T,
|
|
||||||
BOOST_DEDUCED_TYPENAME ::boost::enable_if_c<
|
|
||||||
has_type<range_iterator<T> >::value
|
|
||||||
>::type
|
|
||||||
>
|
|
||||||
: iterator_difference<
|
: iterator_difference<
|
||||||
BOOST_DEDUCED_TYPENAME range_iterator<T>::type
|
BOOST_DEDUCED_TYPENAME range_iterator<T>::type
|
||||||
>
|
>
|
||||||
|
@@ -54,11 +54,20 @@ namespace boost
|
|||||||
inline typename range_size<const SinglePassRange>::type
|
inline typename range_size<const SinglePassRange>::type
|
||||||
size(const SinglePassRange& rng)
|
size(const SinglePassRange& rng)
|
||||||
{
|
{
|
||||||
|
// Very strange things happen on some compilers that have the range concept
|
||||||
|
// asserts disabled. This preprocessor condition is clearly redundant on a
|
||||||
|
// working compiler but is vital for at least some compilers such as clang 4.2
|
||||||
|
// but only on the Mac!
|
||||||
|
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT == 1
|
||||||
|
BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<SinglePassRange>));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
|
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
|
||||||
!BOOST_WORKAROUND(__GNUC__, < 3) \
|
!BOOST_WORKAROUND(__GNUC__, < 3) \
|
||||||
/**/
|
/**/
|
||||||
using namespace range_detail;
|
using namespace range_detail;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return range_calculate_size(rng);
|
return range_calculate_size(rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -68,27 +68,14 @@ namespace boost
|
|||||||
typedef BOOST_DEDUCED_TYPENAME C::size_type type;
|
typedef BOOST_DEDUCED_TYPENAME C::size_type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename C, typename Enabler=void>
|
template<typename C, bool B = range_detail::has_type< range_iterator<C> >::value>
|
||||||
struct range_size
|
struct range_size
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
template<typename C>
|
template<typename C>
|
||||||
struct range_size<
|
struct range_size<C, true>
|
||||||
C,
|
|
||||||
BOOST_DEDUCED_TYPENAME ::boost::enable_if_c<
|
|
||||||
range_detail::has_type< range_iterator<C> >::value
|
|
||||||
>::type
|
|
||||||
>
|
|
||||||
: range_size_<C>
|
: range_size_<C>
|
||||||
{
|
{ };
|
||||||
// Very strange things happen on some compilers that have the range concept
|
|
||||||
// asserts disabled. This preprocessor condition is clearly redundant on a
|
|
||||||
// working compiler but is vital for at least some compilers such as clang 4.2
|
|
||||||
// but only on the Mac!
|
|
||||||
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT == 1
|
|
||||||
BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<C>));
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
|
@@ -182,8 +182,8 @@ public:
|
|||||||
|
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) )
|
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) )
|
||||||
sub_range(const sub_range& r)
|
sub_range(const sub_range& r)
|
||||||
: base(impl::adl_begin(static_cast<const base&>(r)),
|
: base(impl::adl_begin(const_cast<base&>(static_cast<const base&>(r))),
|
||||||
impl::adl_end(static_cast<const base&>(r)))
|
impl::adl_end(const_cast<base&>(static_cast<const base&>(r))))
|
||||||
{ }
|
{ }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user