Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68155 - in trunk: boost/detail boost/graph/distributed boost/range/algorithm_ext libs/detail/test
From: admin_at_[hidden]
Date: 2011-01-14 12:38:01


Author: wash
Date: 2011-01-14 12:37:59 EST (Fri, 14 Jan 2011)
New Revision: 68155
URL: http://svn.boost.org/trac/boost/changeset/68155

Log:
Fixed ambiguity issues when compiling with C++0x support enabled.

Text files modified:
   trunk/boost/detail/is_sorted.hpp | 14 ++++----
   trunk/boost/graph/distributed/connected_components.hpp | 8 ++--
   trunk/boost/range/algorithm_ext/is_sorted.hpp | 4 +-
   trunk/libs/detail/test/is_sorted_test.cpp | 69 ++++++++++++++++++++-------------------
   4 files changed, 48 insertions(+), 47 deletions(-)

Modified: trunk/boost/detail/is_sorted.hpp
==============================================================================
--- trunk/boost/detail/is_sorted.hpp (original)
+++ trunk/boost/detail/is_sorted.hpp 2011-01-14 12:37:59 EST (Fri, 14 Jan 2011)
@@ -16,14 +16,14 @@
 namespace detail {
 
 template<class Iterator, class Comp>
-inline Iterator is_sorted_until (Iterator first, Iterator last, Comp compare) {
+inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) {
   if (first == last)
     return last;
 
   Iterator it = first; ++it;
 
   for (; it != last; first = it, ++it)
- if (compare(*it, *first))
+ if (c(*it, *first))
       return it;
 
   return it;
@@ -34,19 +34,19 @@
   typedef typename boost::detail::iterator_traits<Iterator>::value_type
     value_type;
 
- typedef std::less<value_type> compare;
+ typedef std::less<value_type> c;
 
- return is_sorted_until(first, last, compare());
+ return ::boost::detail::is_sorted_until(first, last, c());
 }
 
 template<class Iterator, class Comp>
-inline bool is_sorted (Iterator first, Iterator last, Comp compare) {
- return is_sorted_until(first, last, compare) == last;
+inline bool is_sorted (Iterator first, Iterator last, Comp c) {
+ return ::boost::detail::is_sorted_until(first, last, c) == last;
 }
 
 template<class Iterator>
 inline bool is_sorted (Iterator first, Iterator last) {
- return is_sorted_until(first, last) == last;
+ return ::boost::detail::is_sorted_until(first, last) == last;
 }
 
 } // detail

Modified: trunk/boost/graph/distributed/connected_components.hpp
==============================================================================
--- trunk/boost/graph/distributed/connected_components.hpp (original)
+++ trunk/boost/graph/distributed/connected_components.hpp 2011-01-14 12:37:59 EST (Fri, 14 Jan 2011)
@@ -557,10 +557,10 @@
                                adj[*liter].begin(), adj[*liter].end() );
 #ifdef PBGL_IN_PLACE_MERGE
 #ifdef PBGL_SORT_ASSERT
- BOOST_ASSERT(boost::detail::is_sorted(my_adj.begin(),
+ BOOST_ASSERT(::boost::detail::is_sorted(my_adj.begin(),
                                                   my_adj.end() - adj[*liter].size(),
                                                   std::less<vertex_descriptor>()));
- BOOST_ASSERT(boost::detail::is_sorted(my_adj.end() - adj[*liter].size(),
+ BOOST_ASSERT(::boost::detail::is_sorted(my_adj.end() - adj[*liter].size(),
                                                   my_adj.end(),
                                                   std::less<vertex_descriptor>()));
 #endif
@@ -605,10 +605,10 @@
 #ifdef PBGL_IN_PLACE_MERGE
             std::size_t num_incoming_edges = incoming_edges.size();
 #ifdef PBGL_SORT_ASSERT
- BOOST_ASSERT(boost::detail::is_sorted(my_adj.begin(),
+ BOOST_ASSERT(::boost::detail::is_sorted(my_adj.begin(),
                                               my_adj.end() - (num_incoming_edges-1),
                                               std::less<vertex_descriptor>()));
- BOOST_ASSERT(boost::detail::is_sorted(my_adj.end() - (num_incoming_edges-1),
+ BOOST_ASSERT(::boost::detail::is_sorted(my_adj.end() - (num_incoming_edges-1),
                                               my_adj.end(),
                                               std::less<vertex_descriptor>()));
 #endif

Modified: trunk/boost/range/algorithm_ext/is_sorted.hpp
==============================================================================
--- trunk/boost/range/algorithm_ext/is_sorted.hpp (original)
+++ trunk/boost/range/algorithm_ext/is_sorted.hpp 2011-01-14 12:37:59 EST (Fri, 14 Jan 2011)
@@ -34,7 +34,7 @@
     BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
     BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept<BOOST_DEDUCED_TYPENAME
       range_value<const SinglePassRange>::type>));
- return boost::detail::is_sorted(boost::begin(rng), boost::end(rng));
+ return ::boost::detail::is_sorted(boost::begin(rng), boost::end(rng));
 }
 
 /// \overload
@@ -45,7 +45,7 @@
     BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate,
       BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type,
       BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type>));
- return boost::detail::is_sorted(boost::begin(rng), boost::end(rng), pred);
+ return ::boost::detail::is_sorted(boost::begin(rng), boost::end(rng), pred);
 }
 
     } // namespace range

Modified: trunk/libs/detail/test/is_sorted_test.cpp
==============================================================================
--- trunk/libs/detail/test/is_sorted_test.cpp (original)
+++ trunk/libs/detail/test/is_sorted_test.cpp 2011-01-14 12:37:59 EST (Fri, 14 Jan 2011)
@@ -71,9 +71,10 @@
   }
 };
 
+
 int main (void) {
- using boost::detail::is_sorted;
- using boost::detail::is_sorted_until;
+ #define IS_SORTED ::boost::detail::is_sorted
+ #define IS_SORTED_UNTIL ::boost::detail::is_sorted_until
   using boost::array;
   using boost::report_errors;
 
@@ -88,41 +89,41 @@
   tracking_greater<int> gt;
   tracking_greater_equal<int> gte;
 
- BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end()), a.end());
- BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end(), lt), a.end());
- BOOST_TEST_EQ(is_sorted_until(a.begin(), a.end(), lte), a.end());
- BOOST_TEST_EQ(*is_sorted_until(a.rbegin(), a.rend(), gt), *a.rend());
- BOOST_TEST_EQ(*is_sorted_until(a.rbegin(), a.rend(), gte), *a.rend());
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end()), a.end());
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lt), a.end());
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(a.begin(), a.end(), lte), a.end());
+ BOOST_TEST_EQ(*IS_SORTED_UNTIL(a.rbegin(), a.rend(), gt), *a.rend());
+ BOOST_TEST_EQ(*IS_SORTED_UNTIL(a.rbegin(), a.rend(), gte), *a.rend());
   
- BOOST_TEST_EQ(is_sorted(a.begin(), a.end()), true);
- BOOST_TEST_EQ(is_sorted(a.begin(), a.end(), lt), true);
- BOOST_TEST_EQ(is_sorted(a.begin(), a.end(), lte), true);
- BOOST_TEST_EQ(is_sorted(a.rbegin(), a.rend(), gt), true);
- BOOST_TEST_EQ(is_sorted(a.rbegin(), a.rend(), gte), true);
-
- BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end()), b.end());
- BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end(), lt), b.end());
- BOOST_TEST_EQ(is_sorted_until(b.begin(), b.end(), lte), &b[2]);
- BOOST_TEST_EQ(*is_sorted_until(b.rbegin(), b.rend(), gt), *b.rend());
- BOOST_TEST_EQ(*is_sorted_until(b.rbegin(), b.rend(), gte), b[2]);
+ BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end()), true);
+ BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lt), true);
+ BOOST_TEST_EQ(IS_SORTED(a.begin(), a.end(), lte), true);
+ BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gt), true);
+ BOOST_TEST_EQ(IS_SORTED(a.rbegin(), a.rend(), gte), true);
+
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end()), b.end());
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lt), b.end());
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(b.begin(), b.end(), lte), &b[2]);
+ BOOST_TEST_EQ(*IS_SORTED_UNTIL(b.rbegin(), b.rend(), gt), *b.rend());
+ BOOST_TEST_EQ(*IS_SORTED_UNTIL(b.rbegin(), b.rend(), gte), b[2]);
   
- BOOST_TEST_EQ(is_sorted(b.begin(), b.end()), true);
- BOOST_TEST_EQ(is_sorted(b.begin(), b.end(), lt), true);
- BOOST_TEST_EQ(is_sorted(b.begin(), b.end(), lte), false);
- BOOST_TEST_EQ(is_sorted(b.rbegin(), b.rend(), gt), true);
- BOOST_TEST_EQ(is_sorted(b.rbegin(), b.rend(), gte), false);
-
- BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end()), &c[2]);
- BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end(), lt), &c[2]);
- BOOST_TEST_EQ(is_sorted_until(c.begin(), c.end(), lte), &c[2]);
- BOOST_TEST_EQ(*is_sorted_until(c.rbegin(), c.rend(), gt), c[7]);
- BOOST_TEST_EQ(*is_sorted_until(c.rbegin(), c.rend(), gte), c[7]);
+ BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end()), true);
+ BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lt), true);
+ BOOST_TEST_EQ(IS_SORTED(b.begin(), b.end(), lte), false);
+ BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gt), true);
+ BOOST_TEST_EQ(IS_SORTED(b.rbegin(), b.rend(), gte), false);
+
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end()), &c[2]);
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lt), &c[2]);
+ BOOST_TEST_EQ(IS_SORTED_UNTIL(c.begin(), c.end(), lte), &c[2]);
+ BOOST_TEST_EQ(*IS_SORTED_UNTIL(c.rbegin(), c.rend(), gt), c[7]);
+ BOOST_TEST_EQ(*IS_SORTED_UNTIL(c.rbegin(), c.rend(), gte), c[7]);
   
- BOOST_TEST_EQ(is_sorted(c.begin(), c.end()), false);
- BOOST_TEST_EQ(is_sorted(c.begin(), c.end(), lt), false);
- BOOST_TEST_EQ(is_sorted(c.begin(), c.end(), lte), false);
- BOOST_TEST_EQ(is_sorted(c.rbegin(), c.rend(), gt), false);
- BOOST_TEST_EQ(is_sorted(c.rbegin(), c.rend(), gte), false);
+ BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end()), false);
+ BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lt), false);
+ BOOST_TEST_EQ(IS_SORTED(c.begin(), c.end(), lte), false);
+ BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gt), false);
+ BOOST_TEST_EQ(IS_SORTED(c.rbegin(), c.rend(), gte), false);
 
   return report_errors();
 }


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