fix use of incomplete fusion::nil as caught by clang

[SVN r74019]
This commit is contained in:
Eric Niebler
2011-08-23 15:13:30 +00:00
parent def510808d
commit df6017dc1c
4 changed files with 31 additions and 46 deletions

View File

@ -20,27 +20,17 @@ namespace boost { namespace fusion
template <typename Stack1, typename Stack2> template <typename Stack1, typename Stack2>
struct segmented_equal_to struct segmented_equal_to
: mpl::and_< : mpl::and_<
result_of::equal_to<
typename Stack1::car_type::begin_type,
typename Stack2::car_type::begin_type
>,
segmented_equal_to< segmented_equal_to<
typename Stack1::cdr_type, typename Stack1::cdr_type,
typename Stack2::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 <> template <>
struct segmented_equal_to<fusion::nil, fusion::nil> struct segmented_equal_to<fusion::nil, fusion::nil>
: mpl::true_ : mpl::true_

View File

@ -7,6 +7,7 @@
#if !defined(BOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED) #if !defined(BOOST_FUSION_SEGMENTED_ITERATOR_SEGMENTED_ITERATOR_HPP_INCLUDED)
#define 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/sequence/intrinsic_fwd.hpp>
#include <boost/fusion/iterator/iterator_facade.hpp> #include <boost/fusion/iterator/iterator_facade.hpp>
#include <boost/fusion/iterator/deref.hpp> #include <boost/fusion/iterator/deref.hpp>
@ -15,7 +16,6 @@
#include <boost/fusion/iterator/value_of.hpp> #include <boost/fusion/iterator/value_of.hpp>
#include <boost/fusion/iterator/value_of_data.hpp> #include <boost/fusion/iterator/value_of_data.hpp>
#include <boost/fusion/iterator/detail/segmented_equal_to.hpp> #include <boost/fusion/iterator/detail/segmented_equal_to.hpp>
#include <boost/fusion/container/list/detail/reverse_cons.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -82,13 +82,8 @@ namespace boost { namespace fusion
//} //}
template <typename It> template <typename It>
struct key_of struct key_of
{ : result_of::key_of<typename It::context_type::car_type::begin_type>
typedef {};
typename result_of::key_of<
typename It::context_type::car_type::begin_type
>::type
type;
};
//auto value_of(it) //auto value_of(it)
//{ //{
@ -96,13 +91,8 @@ namespace boost { namespace fusion
//} //}
template <typename It> template <typename It>
struct value_of struct value_of
{ : result_of::value_of<typename It::context_type::car_type::begin_type>
typedef {};
typename result_of::value_of<
typename It::context_type::car_type::begin_type
>::type
type;
};
//auto value_of_data(it) //auto value_of_data(it)
//{ //{
@ -110,21 +100,26 @@ namespace boost { namespace fusion
//} //}
template <typename It> template <typename It>
struct value_of_data struct value_of_data
{ : result_of::value_of_data<typename It::context_type::car_type::begin_type>
typedef {};
typename result_of::value_of_data<
typename It::context_type::car_type::begin_type
>::type
type;
};
// Compare all the segment iterators in each stack, starting with // Compare all the segment iterators in each stack, starting with
// the bottom-most. // 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 struct equal_to
: mpl::false_
{};
template <typename It1, typename It2, int Size>
struct equal_to<It1, It2, Size, Size>
: detail::segmented_equal_to< : detail::segmented_equal_to<
typename detail::reverse_cons<typename It1::context_type>::type, typename It1::context_type
typename detail::reverse_cons<typename It2::context_type>::type , typename It2::context_type
> >
{}; {};

View File

@ -22,19 +22,19 @@ namespace boost { namespace fusion { namespace detail
// return make_segmented_iterator( segmented_begin_impl( seq, nil ) ); // return make_segmented_iterator( segmented_begin_impl( seq, nil ) );
//} //}
template <typename Sequence> template <typename Sequence, typename Nil = fusion::nil>
struct segmented_begin struct segmented_begin
{ {
typedef typedef
segmented_iterator< segmented_iterator<
typename segmented_begin_impl<Sequence, fusion::nil>::type typename segmented_begin_impl<Sequence, Nil>::type
> >
type; type;
static type call(Sequence& seq) static type call(Sequence& seq)
{ {
return type( return type(
segmented_begin_impl<Sequence, fusion::nil>::call(seq, fusion::nil())); segmented_begin_impl<Sequence, Nil>::call(seq, Nil()));
} }
}; };

View File

@ -7,9 +7,9 @@
#if !defined(BOOST_FUSION_SEGMENTED_END_HPP_INCLUDED) #if !defined(BOOST_FUSION_SEGMENTED_END_HPP_INCLUDED)
#define 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/sequence/intrinsic/detail/segmented_end_impl.hpp>
#include <boost/fusion/iterator/segmented_iterator.hpp> #include <boost/fusion/iterator/segmented_iterator.hpp>
#include <boost/fusion/container/list/cons.hpp>
namespace boost { namespace fusion { namespace detail namespace boost { namespace fusion { namespace detail
{ {
@ -18,19 +18,19 @@ namespace boost { namespace fusion { namespace detail
// return make_segmented_iterator( segmented_end_impl( seq ) ); // return make_segmented_iterator( segmented_end_impl( seq ) );
//} //}
template <typename Sequence> template <typename Sequence, typename Nil = fusion::nil>
struct segmented_end struct segmented_end
{ {
typedef typedef
segmented_iterator< segmented_iterator<
typename segmented_end_impl<Sequence, fusion::nil>::type typename segmented_end_impl<Sequence, Nil>::type
> >
type; type;
static type call(Sequence & seq) static type call(Sequence & seq)
{ {
return type( return type(
segmented_end_impl<Sequence, fusion::nil>::call(seq, fusion::nil())); segmented_end_impl<Sequence, Nil>::call(seq, Nil()));
} }
}; };