Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74019 - in trunk/boost/fusion: iterator/detail sequence/intrinsic/detail
From: eric_at_[hidden]
Date: 2011-08-23 11:13:32


Author: eric_niebler
Date: 2011-08-23 11:13:30 EDT (Tue, 23 Aug 2011)
New Revision: 74019
URL: http://svn.boost.org/trac/boost/changeset/74019

Log:
fix use of incomplete fusion::nil as caught by clang
Text files modified:
   trunk/boost/fusion/iterator/detail/segmented_equal_to.hpp | 18 +++------------
   trunk/boost/fusion/iterator/detail/segmented_iterator.hpp | 45 +++++++++++++++++----------------------
   trunk/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp | 6 ++--
   trunk/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp | 8 +++---
   4 files changed, 31 insertions(+), 46 deletions(-)

Modified: trunk/boost/fusion/iterator/detail/segmented_equal_to.hpp
==============================================================================
--- trunk/boost/fusion/iterator/detail/segmented_equal_to.hpp (original)
+++ trunk/boost/fusion/iterator/detail/segmented_equal_to.hpp 2011-08-23 11:13:30 EDT (Tue, 23 Aug 2011)
@@ -20,27 +20,17 @@
         template <typename Stack1, typename Stack2>
         struct segmented_equal_to
           : mpl::and_<
- result_of::equal_to<
- typename Stack1::car_type::begin_type,
- typename Stack2::car_type::begin_type
- >,
                 segmented_equal_to<
                     typename Stack1::cdr_type,
                     typename Stack2::cdr_type
>
+ , result_of::equal_to<
+ typename Stack1::car_type::begin_type,
+ typename Stack2::car_type::begin_type
+ >
>
         {};
 
- template <typename Stack1>
- struct segmented_equal_to<Stack1, fusion::nil>
- : mpl::false_
- {};
-
- template <typename Stack2>
- struct segmented_equal_to<fusion::nil, Stack2>
- : mpl::false_
- {};
-
         template <>
         struct segmented_equal_to<fusion::nil, fusion::nil>
           : mpl::true_

Modified: trunk/boost/fusion/iterator/detail/segmented_iterator.hpp
==============================================================================
--- trunk/boost/fusion/iterator/detail/segmented_iterator.hpp (original)
+++ trunk/boost/fusion/iterator/detail/segmented_iterator.hpp 2011-08-23 11:13:30 EDT (Tue, 23 Aug 2011)
@@ -7,6 +7,7 @@
 #if !defined(BOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED)
 #define BOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED
 
+#include <boost/mpl/bool.hpp>
 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
 #include <boost/fusion/iterator/iterator_facade.hpp>
 #include <boost/fusion/iterator/deref.hpp>
@@ -15,7 +16,6 @@
 #include <boost/fusion/iterator/value_of.hpp>
 #include <boost/fusion/iterator/value_of_data.hpp>
 #include <boost/fusion/iterator/detail/segmented_equal_to.hpp>
-#include <boost/fusion/container/list/detail/reverse_cons.hpp>
 
 namespace boost { namespace fusion
 {
@@ -82,13 +82,8 @@
         //}
         template <typename It>
         struct key_of
- {
- typedef
- typename result_of::key_of<
- typename It::context_type::car_type::begin_type
- >::type
- type;
- };
+ : result_of::key_of<typename It::context_type::car_type::begin_type>
+ {};
 
         //auto value_of(it)
         //{
@@ -96,13 +91,8 @@
         //}
         template <typename It>
         struct value_of
- {
- typedef
- typename result_of::value_of<
- typename It::context_type::car_type::begin_type
- >::type
- type;
- };
+ : result_of::value_of<typename It::context_type::car_type::begin_type>
+ {};
 
         //auto value_of_data(it)
         //{
@@ -110,21 +100,26 @@
         //}
         template <typename It>
         struct value_of_data
- {
- typedef
- typename result_of::value_of_data<
- typename It::context_type::car_type::begin_type
- >::type
- type;
- };
+ : result_of::value_of_data<typename It::context_type::car_type::begin_type>
+ {};
 
         // Compare all the segment iterators in each stack, starting with
         // the bottom-most.
- template <typename It1, typename It2>
+ template <
+ typename It1
+ , typename It2
+ , int Size1 = It1::context_type::size::value
+ , int Size2 = It2::context_type::size::value
+ >
         struct equal_to
+ : mpl::false_
+ {};
+
+ template <typename It1, typename It2, int Size>
+ struct equal_to<It1, It2, Size, Size>
           : detail::segmented_equal_to<
- typename detail::reverse_cons<typename It1::context_type>::type,
- typename detail::reverse_cons<typename It2::context_type>::type
+ typename It1::context_type
+ , typename It2::context_type
>
         {};
 

Modified: trunk/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp
==============================================================================
--- trunk/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp (original)
+++ trunk/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp 2011-08-23 11:13:30 EDT (Tue, 23 Aug 2011)
@@ -22,19 +22,19 @@
     // return make_segmented_iterator( segmented_begin_impl( seq, nil ) );
     //}
 
- template <typename Sequence>
+ template <typename Sequence, typename Nil = fusion::nil>
     struct segmented_begin
     {
         typedef
             segmented_iterator<
- typename segmented_begin_impl<Sequence, fusion::nil>::type
+ typename segmented_begin_impl<Sequence, Nil>::type
>
         type;
 
         static type call(Sequence& seq)
         {
             return type(
- segmented_begin_impl<Sequence, fusion::nil>::call(seq, fusion::nil()));
+ segmented_begin_impl<Sequence, Nil>::call(seq, Nil()));
         }
     };
 

Modified: trunk/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp
==============================================================================
--- trunk/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp (original)
+++ trunk/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp 2011-08-23 11:13:30 EDT (Tue, 23 Aug 2011)
@@ -7,9 +7,9 @@
 #if !defined(BOOST_FUSION_SEGMENTED_END_HPP_INCLUDED)
 #define BOOST_FUSION_SEGMENTED_END_HPP_INCLUDED
 
-#include <boost/fusion/container/list/cons_fwd.hpp>
 #include <boost/fusion/sequence/intrinsic/detail/segmented_end_impl.hpp>
 #include <boost/fusion/iterator/segmented_iterator.hpp>
+#include <boost/fusion/container/list/cons.hpp>
 
 namespace boost { namespace fusion { namespace detail
 {
@@ -18,19 +18,19 @@
     // return make_segmented_iterator( segmented_end_impl( seq ) );
     //}
 
- template <typename Sequence>
+ template <typename Sequence, typename Nil = fusion::nil>
     struct segmented_end
     {
         typedef
             segmented_iterator<
- typename segmented_end_impl<Sequence, fusion::nil>::type
+ typename segmented_end_impl<Sequence, Nil>::type
>
         type;
 
         static type call(Sequence & seq)
         {
             return type(
- segmented_end_impl<Sequence, fusion::nil>::call(seq, fusion::nil()));
+ segmented_end_impl<Sequence, Nil>::call(seq, Nil()));
         }
     };
 


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