Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63938 - trunk/boost/range/algorithm
From: neil_at_[hidden]
Date: 2010-07-12 18:45:31


Author: neilgroves
Date: 2010-07-12 18:45:30 EDT (Mon, 12 Jul 2010)
New Revision: 63938
URL: http://svn.boost.org/trac/boost/changeset/63938

Log:
[range] experimental commit using disable_if in an attempt to resolve the ambiguity warnings on some compilers.
Text files modified:
   trunk/boost/range/algorithm/upper_bound.hpp | 23 ++++++++++++++++++-----
   1 files changed, 18 insertions(+), 5 deletions(-)

Modified: trunk/boost/range/algorithm/upper_bound.hpp
==============================================================================
--- trunk/boost/range/algorithm/upper_bound.hpp (original)
+++ trunk/boost/range/algorithm/upper_bound.hpp 2010-07-12 18:45:30 EDT (Mon, 12 Jul 2010)
@@ -27,7 +27,11 @@
 ///
 /// \pre ForwardRange is a model of the ForwardRangeConcept
 template< class ForwardRange, class Value >
-inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
+inline
+BOOST_DEDUCED_TYPENAME disable_if<
+ is_const<ForwardRange>,
+ BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
+>::type
 upper_bound( ForwardRange& rng, Value val )
 {
     BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
@@ -36,7 +40,7 @@
 
 /// \overload
 template< class ForwardRange, class Value >
-inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
+BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
 upper_bound( const ForwardRange& rng, Value val )
 {
     BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
@@ -45,7 +49,10 @@
 
 /// \overload
 template< class ForwardRange, class Value, class SortPredicate >
-inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
+inline BOOST_DEDUCED_TYPENAME disable_if<
+ is_const<ForwardRange>,
+ BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
+>::type
 upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
 {
     BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
@@ -63,7 +70,10 @@
 
 /// \overload
 template< range_return_value re, class ForwardRange, class Value >
-inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
+inline BOOST_DEDUCED_TYPENAME disable_if<
+ is_const<ForwardRange>,
+ BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
+>::type
 upper_bound( ForwardRange& rng, Value val )
 {
     BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
@@ -86,7 +96,10 @@
 /// \overload
 template< range_return_value re, class ForwardRange, class Value,
           class SortPredicate >
-inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
+inline BOOST_DEDUCED_TYPENAME disable_if<
+ is_const<ForwardRange>,
+ BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
+>::type
 upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
 {
     BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk