Workaround for ObjC (mis)use of nil (from Mathias Gaunard)

[SVN r81628]
This commit is contained in:
Joel de Guzman
2012-11-30 02:31:23 +00:00
parent 8d6200ef58
commit 6d265316ed
29 changed files with 64 additions and 61 deletions

View File

@ -11,11 +11,11 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
namespace result_of
{
template <typename Car, typename Cdr = nil>
template <typename Car, typename Cdr = nil_>
struct cons_tie
{
typedef cons<Car&, Cdr> type;

View File

@ -13,11 +13,11 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
namespace result_of
{
template <typename Car, typename Cdr = nil>
template <typename Car, typename Cdr = nil_>
struct make_cons
{
typedef cons<typename detail::as_fusion_element<Car>::type, Cdr> type;

View File

@ -34,7 +34,7 @@ namespace boost { namespace fusion
struct forward_traversal_tag;
struct fusion_sequence_tag;
struct nil : sequence_base<nil>
struct nil_ : sequence_base<nil_>
{
typedef mpl::int_<0> size;
typedef cons_tag fusion_tag;
@ -44,10 +44,10 @@ namespace boost { namespace fusion
typedef void_ car_type;
typedef void_ cdr_type;
nil() {}
nil_() {}
template <typename Iterator>
nil(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/)
nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/)
{}
template <typename Iterator>
@ -56,7 +56,7 @@ namespace boost { namespace fusion
}
};
template <typename Car, typename Cdr /*= nil*/>
template <typename Car, typename Cdr /*= nil_*/>
struct cons : sequence_base<cons<Car, Cdr> >
{
typedef mpl::int_<Cdr::size::value+1> size;

View File

@ -2,7 +2,7 @@
Copyright (c) 2001-2011 Joel de Guzman
Copyright (c) 2005 Eric Niebler
Distributed under the Boost Software License, Version 1.0. (See accompanying
Distributed under 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)
==============================================================================*/
#if !defined(BOOST_FUSION_CONS_FWD_HPP_INCLUDED)
@ -10,9 +10,12 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
#ifndef nil
typedef nil_ nil;
#endif
template <typename Car, typename Cdr = nil>
template <typename Car, typename Cdr = nil_>
struct cons;
}}

View File

@ -18,14 +18,14 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct cons_iterator_tag;
struct forward_traversal_tag;
template <typename Cons>
struct cons_iterator_identity;
template <typename Cons = nil>
template <typename Cons = nil_>
struct cons_iterator : iterator_base<cons_iterator<Cons> >
{
typedef cons_iterator_tag fusion_tag;
@ -49,40 +49,40 @@ namespace boost { namespace fusion
{
typedef forward_traversal_tag category;
typedef cons_iterator_tag fusion_tag;
typedef nil cons_type;
typedef nil_ cons_type;
typedef cons_iterator_identity<
add_const<nil>::type>
add_const<nil_>::type>
identity;
nil_iterator() {}
explicit nil_iterator(nil const&) {}
explicit nil_iterator(nil_ const&) {}
};
template <>
struct cons_iterator<nil> : nil_iterator
struct cons_iterator<nil_> : nil_iterator
{
cons_iterator() {}
explicit cons_iterator(nil const&) {}
explicit cons_iterator(nil_ const&) {}
};
template <>
struct cons_iterator<nil const> : nil_iterator
struct cons_iterator<nil_ const> : nil_iterator
{
cons_iterator() {}
explicit cons_iterator(nil const&) {}
explicit cons_iterator(nil_ const&) {}
};
template <>
struct cons_iterator<list<> > : nil_iterator
{
cons_iterator() {}
explicit cons_iterator(nil const&) {}
explicit cons_iterator(nil_ const&) {}
};
template <>
struct cons_iterator<list<> const> : nil_iterator
{
cons_iterator() {}
explicit cons_iterator(nil const&) {}
explicit cons_iterator(nil_ const&) {}
};
}}

View File

@ -13,7 +13,7 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct cons_tag;

View File

@ -24,12 +24,12 @@ namespace boost { namespace fusion { namespace detail
template <typename First, typename Last>
struct build_cons<First, Last, true>
{
typedef nil type;
typedef nil_ type;
static nil
static nil_
call(First const&, Last const&)
{
return nil();
return nil_();
}
};

View File

@ -13,7 +13,7 @@ namespace boost { namespace fusion
{
struct cons_tag;
struct nil;
struct nil_;
template <typename Car, typename Cdr>
struct cons;
@ -28,7 +28,7 @@ namespace boost { namespace fusion
{
template <typename Sequence>
struct apply
: boost::is_convertible<Sequence, nil>
: boost::is_convertible<Sequence, nil_>
{};
};
}

View File

@ -13,7 +13,7 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct cons_tag;
@ -35,7 +35,7 @@ namespace boost { namespace fusion
struct apply
{
typedef cons_iterator<
typename mpl::if_<is_const<Sequence>, nil const, nil>::type>
typename mpl::if_<is_const<Sequence>, nil_ const, nil_>::type>
type;
static type

View File

@ -18,7 +18,7 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
}}
@ -61,7 +61,7 @@ namespace boost { namespace fusion { namespace detail
template <>
struct list_to_cons<BOOST_PP_ENUM(FUSION_MAX_LIST_SIZE, FUSION_VOID, _)>
{
typedef nil type;
typedef nil_ type;
};
}}}

View File

@ -8,7 +8,7 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9>
struct list

View File

@ -8,7 +8,7 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19>
struct list

View File

@ -8,7 +8,7 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29>
struct list

View File

@ -8,7 +8,7 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39>
struct list

View File

@ -8,7 +8,7 @@
==============================================================================*/
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
template <typename T0 , typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 , typename T15 , typename T16 , typename T17 , typename T18 , typename T19 , typename T20 , typename T21 , typename T22 , typename T23 , typename T24 , typename T25 , typename T26 , typename T27 , typename T28 , typename T29 , typename T30 , typename T31 , typename T32 , typename T33 , typename T34 , typename T35 , typename T36 , typename T37 , typename T38 , typename T39 , typename T40 , typename T41 , typename T42 , typename T43 , typename T44 , typename T45 , typename T46 , typename T47 , typename T48 , typename T49>
struct list

View File

@ -81,6 +81,6 @@ namespace boost { namespace fusion { namespace detail
template <>
struct list_to_cons<void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_>
{
typedef nil type;
typedef nil_ type;
};
}}}

View File

@ -141,6 +141,6 @@ namespace boost { namespace fusion { namespace detail
template <>
struct list_to_cons<void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_>
{
typedef nil type;
typedef nil_ type;
};
}}}

View File

@ -201,6 +201,6 @@ namespace boost { namespace fusion { namespace detail
template <>
struct list_to_cons<void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_>
{
typedef nil type;
typedef nil_ type;
};
}}}

View File

@ -261,6 +261,6 @@ namespace boost { namespace fusion { namespace detail
template <>
struct list_to_cons<void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_>
{
typedef nil type;
typedef nil_ type;
};
}}}

View File

@ -321,6 +321,6 @@ namespace boost { namespace fusion { namespace detail
template <>
struct list_to_cons<void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_ , void_>
{
typedef nil type;
typedef nil_ type;
};
}}}

View File

@ -12,7 +12,7 @@
namespace boost { namespace fusion { namespace detail
{
////////////////////////////////////////////////////////////////////////////
template<typename Cons, typename State = nil>
template<typename Cons, typename State = nil_>
struct reverse_cons;
template<typename Car, typename Cdr, typename State>
@ -29,11 +29,11 @@ namespace boost { namespace fusion { namespace detail
};
template<typename State>
struct reverse_cons<nil, State>
struct reverse_cons<nil_, State>
{
typedef State type;
static State const &call(nil const &, State const &state = State())
static State const &call(nil_ const &, State const &state = State())
{
return state;
}

View File

@ -32,7 +32,7 @@
namespace boost { namespace fusion
{
struct nil;
struct nil_;
struct void_;
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_LIST_SIZE, typename T)>