Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50509 - in sandbox/partition_point/boost: partition_point partition_point/detail range range/detail
From: aschoedl_at_[hidden]
Date: 2009-01-08 03:59:51


Author: schoedl
Date: 2009-01-08 03:59:49 EST (Thu, 08 Jan 2009)
New Revision: 50509
URL: http://svn.boost.org/trac/boost/changeset/50509

Log:
lazy_typedef change moved into Boost.Range
Added:
   sandbox/partition_point/boost/range/
   sandbox/partition_point/boost/range/const_iterator.hpp (contents, props changed)
   sandbox/partition_point/boost/range/detail/
   sandbox/partition_point/boost/range/detail/lazy_typedef.hpp (contents, props changed)
   sandbox/partition_point/boost/range/mutable_iterator.hpp (contents, props changed)
Removed:
   sandbox/partition_point/boost/partition_point/detail/
Text files modified:
   sandbox/partition_point/boost/partition_point/partition_range_algorithms.hpp | 88 +++------------------------------------
   1 files changed, 8 insertions(+), 80 deletions(-)

Modified: sandbox/partition_point/boost/partition_point/partition_range_algorithms.hpp
==============================================================================
--- sandbox/partition_point/boost/partition_point/partition_range_algorithms.hpp (original)
+++ sandbox/partition_point/boost/partition_point/partition_range_algorithms.hpp 2009-01-08 03:59:49 EST (Thu, 08 Jan 2009)
@@ -10,119 +10,47 @@
 #include <boost/range/begin.hpp>
 #include <boost/range/end.hpp>
 #include <boost/range/sub_range.hpp>
-#include <boost/partition_point/detail/lazy_typedef.hpp>
 
 namespace boost {
- namespace improved {
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
- // Versions of range_const/mutable_iterator<C> that if C::(const_)iterator is undefined,
- // do not define range_const/mutable_iterator<C>::type, instead of defining it but
- // failing to compile when type is actually accessed. This helps disambiguating overloads.
-
- //////////////////////////////////////////////////////////////////////////
- // default
- //////////////////////////////////////////////////////////////////////////
-
- namespace detail { namespace range {
- BOOST_DECLARE_LAZY_TYPEDEF( const_iterator )
- }}
-
- template< typename C >
- struct range_const_iterator: detail::range::lazy_typedef_const_iterator<C>
- {};
-
- //////////////////////////////////////////////////////////////////////////
- // pair
- //////////////////////////////////////////////////////////////////////////
-
- template< typename Iterator >
- struct range_const_iterator< std::pair<Iterator,Iterator> >
- {
- typedef Iterator type;
- };
-
- //////////////////////////////////////////////////////////////////////////
- // array
- //////////////////////////////////////////////////////////////////////////
-
- template< typename T, std::size_t sz >
- struct range_const_iterator< T[sz] >
- {
- typedef const T* type;
- };
-
- //////////////////////////////////////////////////////////////////////////
- // default
- //////////////////////////////////////////////////////////////////////////
-
- namespace detail { namespace range {
- BOOST_DECLARE_LAZY_TYPEDEF( iterator )
- }}
-
- template< typename C >
- struct range_mutable_iterator: detail::range::lazy_typedef_iterator<C>
- {};
-
- //////////////////////////////////////////////////////////////////////////
- // pair
- //////////////////////////////////////////////////////////////////////////
-
- template< typename Iterator >
- struct range_mutable_iterator< std::pair<Iterator,Iterator> >
- {
- typedef Iterator type;
- };
-
- //////////////////////////////////////////////////////////////////////////
- // array
- //////////////////////////////////////////////////////////////////////////
-
- template< typename T, std::size_t sz >
- struct range_mutable_iterator< T[sz] >
- {
- typedef T* type;
- };
- } // namespace improved
-
         namespace partition_algorithms_adl_barrier {
 
                 template< typename Rng, typename Val >
- BOOST_DEDUCED_TYPENAME boost::improved::range_const_iterator<Rng>::type lower_bound(Rng const& rng,Val const& x) {
+ BOOST_DEDUCED_TYPENAME boost::range_const_iterator<Rng>::type lower_bound(Rng const& rng,Val const& x) {
                         return boost::lower_bound(boost::begin(rng),boost::end(rng),x);
                 }
 
                 template< typename Rng, typename Val >
- BOOST_DEDUCED_TYPENAME boost::improved::range_mutable_iterator<Rng>::type lower_bound(Rng & rng,Val const& x) {
+ BOOST_DEDUCED_TYPENAME boost::range_mutable_iterator<Rng>::type lower_bound(Rng & rng,Val const& x) {
                         return boost::lower_bound(boost::begin(rng),boost::end(rng),x);
                 }
 
                 template< typename Rng, typename Val, typename BinPred>
- BOOST_DEDUCED_TYPENAME boost::improved::range_const_iterator<Rng>::type lower_bound(Rng const& rng,Val const& x,BinPred pred) {
+ BOOST_DEDUCED_TYPENAME boost::range_const_iterator<Rng>::type lower_bound(Rng const& rng,Val const& x,BinPred pred) {
                         return boost::lower_bound(boost::begin(rng),boost::end(rng),x,pred);
                 }
 
                 template< typename Rng, typename Val, typename BinPred>
- BOOST_DEDUCED_TYPENAME boost::improved::range_mutable_iterator<Rng>::type lower_bound(Rng & rng,Val const& x,BinPred pred) {
+ BOOST_DEDUCED_TYPENAME boost::range_mutable_iterator<Rng>::type lower_bound(Rng & rng,Val const& x,BinPred pred) {
                         return boost::lower_bound(boost::begin(rng),boost::end(rng),x,pred);
                 }
 
                 template< typename Rng, typename Val >
- BOOST_DEDUCED_TYPENAME boost::improved::range_const_iterator<Rng>::type upper_bound(Rng const& rng,Val const& x) {
+ BOOST_DEDUCED_TYPENAME boost::range_const_iterator<Rng>::type upper_bound(Rng const& rng,Val const& x) {
                         return boost::upper_bound(boost::begin(rng),boost::end(rng),x);
                 }
 
                 template< typename Rng, typename Val >
- BOOST_DEDUCED_TYPENAME boost::improved::range_mutable_iterator<Rng>::type upper_bound(Rng & rng,Val const& x) {
+ BOOST_DEDUCED_TYPENAME boost::range_mutable_iterator<Rng>::type upper_bound(Rng & rng,Val const& x) {
                         return boost::upper_bound(boost::begin(rng),boost::end(rng),x);
                 }
 
                 template< typename Rng, typename Val, typename BinPred>
- BOOST_DEDUCED_TYPENAME boost::improved::range_const_iterator<Rng>::type upper_bound(Rng const& rng,Val const& x,BinPred pred) {
+ BOOST_DEDUCED_TYPENAME boost::range_const_iterator<Rng>::type upper_bound(Rng const& rng,Val const& x,BinPred pred) {
                         return boost::upper_bound(boost::begin(rng),boost::end(rng),x,pred);
                 }
 
                 template< typename Rng, typename Val, typename BinPred>
- BOOST_DEDUCED_TYPENAME boost::improved::range_mutable_iterator<Rng>::type upper_bound(Rng & rng,Val const& x,BinPred pred) {
+ BOOST_DEDUCED_TYPENAME boost::range_mutable_iterator<Rng>::type upper_bound(Rng & rng,Val const& x,BinPred pred) {
                         return boost::upper_bound(boost::begin(rng),boost::end(rng),x,pred);
                 }
 

Added: sandbox/partition_point/boost/range/const_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/partition_point/boost/range/const_iterator.hpp 2009-01-08 03:59:49 EST (Thu, 08 Jan 2009)
@@ -0,0 +1,67 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_CONST_ITERATOR_HPP
+#define BOOST_RANGE_CONST_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/range/config.hpp>
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/range/detail/const_iterator.hpp>
+#else
+
+#include <boost/range/detail/lazy_typedef.hpp>
+#include <boost/type_traits/remove_const.hpp>
+#include <cstddef>
+#include <utility>
+
+namespace boost
+{
+ //////////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////////
+
+ namespace detail { namespace range {
+ BOOST_DECLARE_LAZY_TYPEDEF( const_iterator )
+ }}
+
+ template< typename C >
+ struct range_const_iterator: detail::range::lazy_typedef_const_iterator<C>
+ {};
+
+ //////////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ struct range_const_iterator< std::pair<Iterator,Iterator> >
+ {
+ typedef Iterator type;
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename T, std::size_t sz >
+ struct range_const_iterator< T[sz] >
+ {
+ typedef const T* type;
+ };
+
+} // namespace boost
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif

Added: sandbox/partition_point/boost/range/detail/lazy_typedef.hpp
==============================================================================
--- (empty file)
+++ sandbox/partition_point/boost/range/detail/lazy_typedef.hpp 2009-01-08 03:59:49 EST (Thu, 08 Jan 2009)
@@ -0,0 +1,42 @@
+#ifndef BOOST_RANGE_DETAIL_LAZY_TYPEDEF_HPP
+#define BOOST_RANGE_DETAIL_LAZY_TYPEDEF_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // required for lazy_typedef to work as intended
+
+namespace boost { namespace detail { namespace range {
+ template< typename T > struct exists { typedef void type; };
+}}} // boost::detail::range
+
+// Defines lazy_typedef_[some_typedef]<T> which exposes T::[some_typedef]
+// as lazy_typedef_[some_typedef]<T>::type if T::[some_typedef] exists.
+// Otherwise lazy_typedef_[some_typedef]<T> is empty.
+#define BOOST_DECLARE_LAZY_TYPEDEF( some_typedef ) \
+ template< typename C, typename Enable=void > \
+ struct lazy_typedef_ ## some_typedef \
+ {}; \
+ template< typename C > \
+ struct lazy_typedef_ ## some_typedef< C, \
+ BOOST_DEDUCED_TYPENAME boost::detail::range::exists< \
+ BOOST_DEDUCED_TYPENAME C::some_typedef >::type \
+ > { \
+ typedef BOOST_DEDUCED_TYPENAME C::some_typedef type; \
+ };
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#define BOOST_DECLARE_LAZY_TYPEDEF( some_typedef ) \
+ template< typename C > \
+ struct lazy_typedef_ ## some_typedef \
+ { \
+ typedef BOOST_DEDUCED_TYPENAME C::some_typedef type; \
+ };
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif // BOOST_RANGE_DETAIL_LAZY_TYPEDEF_HPP

Added: sandbox/partition_point/boost/range/mutable_iterator.hpp
==============================================================================
--- (empty file)
+++ sandbox/partition_point/boost/range/mutable_iterator.hpp 2009-01-08 03:59:49 EST (Thu, 08 Jan 2009)
@@ -0,0 +1,67 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_MUTABLE_ITERATOR_HPP
+#define BOOST_RANGE_MUTABLE_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <boost/range/config.hpp>
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/range/detail/iterator.hpp>
+#else
+
+#include <boost/range/detail/lazy_typedef.hpp>
+#include <boost/iterator/iterator_traits.hpp>
+#include <cstddef>
+#include <utility>
+
+namespace boost
+{
+ //////////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////////
+
+ namespace detail { namespace range {
+ BOOST_DECLARE_LAZY_TYPEDEF( iterator )
+ }}
+
+ template< typename C >
+ struct range_mutable_iterator: detail::range::lazy_typedef_iterator<C>
+ {};
+
+ //////////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ struct range_mutable_iterator< std::pair<Iterator,Iterator> >
+ {
+ typedef Iterator type;
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename T, std::size_t sz >
+ struct range_mutable_iterator< T[sz] >
+ {
+ typedef T* type;
+ };
+
+} // namespace boost
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif


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