[boost][range] - fix a very odd compilation problem in range_size that only occurs on clang 4.2 on the Mac (clang 4.2 on linux is fine)

[SVN r85717]
This commit is contained in:
Neil Groves
2013-09-16 23:23:38 +00:00
parent cca9739022
commit 34cea300e5

View File

@ -76,14 +76,22 @@ namespace boost
struct range_size : struct range_size :
detail::range_size<T> detail::range_size<T>
{ {
// 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<T>)); BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<T>));
#endif
}; };
template< class T > template< class T >
struct range_size<const T > struct range_size<const T >
: detail::range_size<T> : detail::range_size<T>
{ {
#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT == 1
BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<T>)); BOOST_RANGE_CONCEPT_ASSERT((boost::SinglePassRangeConcept<T>));
#endif
}; };
} // namespace boost } // namespace boost