From 6d265316edb894756d5518b69eca9e702af78c55 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Fri, 30 Nov 2012 02:31:23 +0000 Subject: [PATCH] Workaround for ObjC (mis)use of nil (from Mathias Gaunard) [SVN r81628] --- .../fusion/container/generation/cons_tie.hpp | 4 ++-- .../fusion/container/generation/make_cons.hpp | 4 ++-- include/boost/fusion/container/list/cons.hpp | 8 +++---- .../boost/fusion/container/list/cons_fwd.hpp | 9 +++++--- .../fusion/container/list/cons_iterator.hpp | 22 +++++++++---------- .../container/list/detail/begin_impl.hpp | 2 +- .../container/list/detail/build_cons.hpp | 6 ++--- .../container/list/detail/empty_impl.hpp | 4 ++-- .../fusion/container/list/detail/end_impl.hpp | 4 ++-- .../container/list/detail/list_to_cons.hpp | 4 ++-- .../list/detail/preprocessed/list10.hpp | 2 +- .../list/detail/preprocessed/list20.hpp | 2 +- .../list/detail/preprocessed/list30.hpp | 2 +- .../list/detail/preprocessed/list40.hpp | 2 +- .../list/detail/preprocessed/list50.hpp | 2 +- .../detail/preprocessed/list_to_cons10.hpp | 2 +- .../detail/preprocessed/list_to_cons20.hpp | 2 +- .../detail/preprocessed/list_to_cons30.hpp | 2 +- .../detail/preprocessed/list_to_cons40.hpp | 2 +- .../detail/preprocessed/list_to_cons50.hpp | 2 +- .../container/list/detail/reverse_cons.hpp | 6 ++--- include/boost/fusion/container/list/list.hpp | 2 +- .../iterator/detail/segmented_equal_to.hpp | 4 ++-- .../iterator/detail/segmented_iterator.hpp | 2 +- .../iterator/detail/segmented_next_impl.hpp | 2 +- .../intrinsic/detail/segmented_begin.hpp | 4 ++-- .../intrinsic/detail/segmented_end.hpp | 2 +- .../fusion/support/segmented_fold_until.hpp | 8 +++---- .../detail/segmented_iterator_range.hpp | 8 +++---- 29 files changed, 64 insertions(+), 61 deletions(-) diff --git a/include/boost/fusion/container/generation/cons_tie.hpp b/include/boost/fusion/container/generation/cons_tie.hpp index 4459e0c3..e42b4202 100644 --- a/include/boost/fusion/container/generation/cons_tie.hpp +++ b/include/boost/fusion/container/generation/cons_tie.hpp @@ -11,11 +11,11 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; namespace result_of { - template + template struct cons_tie { typedef cons type; diff --git a/include/boost/fusion/container/generation/make_cons.hpp b/include/boost/fusion/container/generation/make_cons.hpp index dcb606dc..b11394bf 100644 --- a/include/boost/fusion/container/generation/make_cons.hpp +++ b/include/boost/fusion/container/generation/make_cons.hpp @@ -13,11 +13,11 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; namespace result_of { - template + template struct make_cons { typedef cons::type, Cdr> type; diff --git a/include/boost/fusion/container/list/cons.hpp b/include/boost/fusion/container/list/cons.hpp index 666b5367..8a04049f 100644 --- a/include/boost/fusion/container/list/cons.hpp +++ b/include/boost/fusion/container/list/cons.hpp @@ -34,7 +34,7 @@ namespace boost { namespace fusion struct forward_traversal_tag; struct fusion_sequence_tag; - struct nil : sequence_base + struct nil_ : sequence_base { 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 - nil(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) + nil_(Iterator const& /*iter*/, mpl::true_ /*this_is_an_iterator*/) {} template @@ -56,7 +56,7 @@ namespace boost { namespace fusion } }; - template + template struct cons : sequence_base > { typedef mpl::int_ size; diff --git a/include/boost/fusion/container/list/cons_fwd.hpp b/include/boost/fusion/container/list/cons_fwd.hpp index 80bb0443..547c42ca 100644 --- a/include/boost/fusion/container/list/cons_fwd.hpp +++ b/include/boost/fusion/container/list/cons_fwd.hpp @@ -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 + template struct cons; }} diff --git a/include/boost/fusion/container/list/cons_iterator.hpp b/include/boost/fusion/container/list/cons_iterator.hpp index bc4fa094..834651d5 100644 --- a/include/boost/fusion/container/list/cons_iterator.hpp +++ b/include/boost/fusion/container/list/cons_iterator.hpp @@ -18,14 +18,14 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; struct cons_iterator_tag; struct forward_traversal_tag; template struct cons_iterator_identity; - template + template struct cons_iterator : iterator_base > { 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::type> + add_const::type> identity; nil_iterator() {} - explicit nil_iterator(nil const&) {} + explicit nil_iterator(nil_ const&) {} }; template <> - struct cons_iterator : nil_iterator + struct cons_iterator : nil_iterator { cons_iterator() {} - explicit cons_iterator(nil const&) {} + explicit cons_iterator(nil_ const&) {} }; template <> - struct cons_iterator : nil_iterator + struct cons_iterator : nil_iterator { cons_iterator() {} - explicit cons_iterator(nil const&) {} + explicit cons_iterator(nil_ const&) {} }; template <> struct cons_iterator > : nil_iterator { cons_iterator() {} - explicit cons_iterator(nil const&) {} + explicit cons_iterator(nil_ const&) {} }; template <> struct cons_iterator const> : nil_iterator { cons_iterator() {} - explicit cons_iterator(nil const&) {} + explicit cons_iterator(nil_ const&) {} }; }} diff --git a/include/boost/fusion/container/list/detail/begin_impl.hpp b/include/boost/fusion/container/list/detail/begin_impl.hpp index 571e6811..27a73422 100644 --- a/include/boost/fusion/container/list/detail/begin_impl.hpp +++ b/include/boost/fusion/container/list/detail/begin_impl.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; struct cons_tag; diff --git a/include/boost/fusion/container/list/detail/build_cons.hpp b/include/boost/fusion/container/list/detail/build_cons.hpp index ef486522..725b286d 100644 --- a/include/boost/fusion/container/list/detail/build_cons.hpp +++ b/include/boost/fusion/container/list/detail/build_cons.hpp @@ -24,12 +24,12 @@ namespace boost { namespace fusion { namespace detail template struct build_cons { - typedef nil type; + typedef nil_ type; - static nil + static nil_ call(First const&, Last const&) { - return nil(); + return nil_(); } }; diff --git a/include/boost/fusion/container/list/detail/empty_impl.hpp b/include/boost/fusion/container/list/detail/empty_impl.hpp index 5c92c733..2392dd7f 100644 --- a/include/boost/fusion/container/list/detail/empty_impl.hpp +++ b/include/boost/fusion/container/list/detail/empty_impl.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion { struct cons_tag; - struct nil; + struct nil_; template struct cons; @@ -28,7 +28,7 @@ namespace boost { namespace fusion { template struct apply - : boost::is_convertible + : boost::is_convertible {}; }; } diff --git a/include/boost/fusion/container/list/detail/end_impl.hpp b/include/boost/fusion/container/list/detail/end_impl.hpp index 3792250c..a2eafbaf 100644 --- a/include/boost/fusion/container/list/detail/end_impl.hpp +++ b/include/boost/fusion/container/list/detail/end_impl.hpp @@ -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_, nil const, nil>::type> + typename mpl::if_, nil_ const, nil_>::type> type; static type diff --git a/include/boost/fusion/container/list/detail/list_to_cons.hpp b/include/boost/fusion/container/list/detail/list_to_cons.hpp index 4a7dbb83..07c11af2 100644 --- a/include/boost/fusion/container/list/detail/list_to_cons.hpp +++ b/include/boost/fusion/container/list/detail/list_to_cons.hpp @@ -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 { - typedef nil type; + typedef nil_ type; }; }}} diff --git a/include/boost/fusion/container/list/detail/preprocessed/list10.hpp b/include/boost/fusion/container/list/detail/preprocessed/list10.hpp index e233b46d..d02ba872 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list10.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list10.hpp @@ -8,7 +8,7 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct nil; + struct nil_; struct void_; template struct list diff --git a/include/boost/fusion/container/list/detail/preprocessed/list20.hpp b/include/boost/fusion/container/list/detail/preprocessed/list20.hpp index 405681a1..730d1c08 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list20.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list20.hpp @@ -8,7 +8,7 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct nil; + struct nil_; struct void_; template struct list diff --git a/include/boost/fusion/container/list/detail/preprocessed/list30.hpp b/include/boost/fusion/container/list/detail/preprocessed/list30.hpp index 841295ef..6e6a1433 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list30.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list30.hpp @@ -8,7 +8,7 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct nil; + struct nil_; struct void_; template struct list diff --git a/include/boost/fusion/container/list/detail/preprocessed/list40.hpp b/include/boost/fusion/container/list/detail/preprocessed/list40.hpp index c486f6b8..e4f3b38f 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list40.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list40.hpp @@ -8,7 +8,7 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct nil; + struct nil_; struct void_; template struct list diff --git a/include/boost/fusion/container/list/detail/preprocessed/list50.hpp b/include/boost/fusion/container/list/detail/preprocessed/list50.hpp index 21264094..fc5231f2 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list50.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list50.hpp @@ -8,7 +8,7 @@ ==============================================================================*/ namespace boost { namespace fusion { - struct nil; + struct nil_; struct void_; template struct list diff --git a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons10.hpp b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons10.hpp index a0f01f51..9b9377c9 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons10.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons10.hpp @@ -81,6 +81,6 @@ namespace boost { namespace fusion { namespace detail template <> struct list_to_cons { - typedef nil type; + typedef nil_ type; }; }}} diff --git a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons20.hpp b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons20.hpp index b90b7a76..b142e266 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons20.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons20.hpp @@ -141,6 +141,6 @@ namespace boost { namespace fusion { namespace detail template <> struct list_to_cons { - typedef nil type; + typedef nil_ type; }; }}} diff --git a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons30.hpp b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons30.hpp index 8b8a046d..814b7a4f 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons30.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons30.hpp @@ -201,6 +201,6 @@ namespace boost { namespace fusion { namespace detail template <> struct list_to_cons { - typedef nil type; + typedef nil_ type; }; }}} diff --git a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons40.hpp b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons40.hpp index a435c021..69291485 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons40.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons40.hpp @@ -261,6 +261,6 @@ namespace boost { namespace fusion { namespace detail template <> struct list_to_cons { - typedef nil type; + typedef nil_ type; }; }}} diff --git a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons50.hpp b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons50.hpp index 7837e9c2..1dbef681 100644 --- a/include/boost/fusion/container/list/detail/preprocessed/list_to_cons50.hpp +++ b/include/boost/fusion/container/list/detail/preprocessed/list_to_cons50.hpp @@ -321,6 +321,6 @@ namespace boost { namespace fusion { namespace detail template <> struct list_to_cons { - typedef nil type; + typedef nil_ type; }; }}} diff --git a/include/boost/fusion/container/list/detail/reverse_cons.hpp b/include/boost/fusion/container/list/detail/reverse_cons.hpp index 59178e84..5083e0c0 100644 --- a/include/boost/fusion/container/list/detail/reverse_cons.hpp +++ b/include/boost/fusion/container/list/detail/reverse_cons.hpp @@ -12,7 +12,7 @@ namespace boost { namespace fusion { namespace detail { //////////////////////////////////////////////////////////////////////////// - template + template struct reverse_cons; template @@ -29,11 +29,11 @@ namespace boost { namespace fusion { namespace detail }; template - struct reverse_cons + struct reverse_cons { 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; } diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp index 45e2f637..1d902059 100644 --- a/include/boost/fusion/container/list/list.hpp +++ b/include/boost/fusion/container/list/list.hpp @@ -32,7 +32,7 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; struct void_; template diff --git a/include/boost/fusion/iterator/detail/segmented_equal_to.hpp b/include/boost/fusion/iterator/detail/segmented_equal_to.hpp index 1e4ad268..14982b86 100644 --- a/include/boost/fusion/iterator/detail/segmented_equal_to.hpp +++ b/include/boost/fusion/iterator/detail/segmented_equal_to.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; namespace detail { @@ -32,7 +32,7 @@ namespace boost { namespace fusion {}; template <> - struct segmented_equal_to + struct segmented_equal_to : mpl::true_ {}; } diff --git a/include/boost/fusion/iterator/detail/segmented_iterator.hpp b/include/boost/fusion/iterator/detail/segmented_iterator.hpp index ccd45fbf..a5cfb450 100644 --- a/include/boost/fusion/iterator/detail/segmented_iterator.hpp +++ b/include/boost/fusion/iterator/detail/segmented_iterator.hpp @@ -19,7 +19,7 @@ namespace boost { namespace fusion { - struct nil; + struct nil_; namespace detail { diff --git a/include/boost/fusion/iterator/detail/segmented_next_impl.hpp b/include/boost/fusion/iterator/detail/segmented_next_impl.hpp index 2a7f6f6c..0c5f9f51 100644 --- a/include/boost/fusion/iterator/detail/segmented_next_impl.hpp +++ b/include/boost/fusion/iterator/detail/segmented_next_impl.hpp @@ -83,7 +83,7 @@ namespace boost { namespace fusion //auto segmented_next_impl_recurse3(stack) //{ // if (size(stack) == 1) - // return cons(iterator_range(end(car(stack)), end(car(stack))), nil); + // return cons(iterator_range(end(car(stack)), end(car(stack))), nil_); // else // return segmented_next_impl_recurse(stack.cdr); //} diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp index 968718eb..7f337ce1 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp @@ -19,10 +19,10 @@ namespace boost { namespace fusion { namespace detail { //auto segmented_begin( seq ) //{ - // return make_segmented_iterator( segmented_begin_impl( seq, nil ) ); + // return make_segmented_iterator( segmented_begin_impl( seq, nil_ ) ); //} - template + template struct segmented_begin { typedef diff --git a/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp b/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp index 469862ac..f62c97aa 100644 --- a/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp +++ b/include/boost/fusion/sequence/intrinsic/detail/segmented_end.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { namespace detail // return make_segmented_iterator( segmented_end_impl( seq ) ); //} - template + template struct segmented_end { typedef diff --git a/include/boost/fusion/support/segmented_fold_until.hpp b/include/boost/fusion/support/segmented_fold_until.hpp index 6ea58ac6..724e2a49 100644 --- a/include/boost/fusion/support/segmented_fold_until.hpp +++ b/include/boost/fusion/support/segmented_fold_until.hpp @@ -20,7 +20,7 @@ namespace boost { namespace fusion { //auto segmented_fold_until(seq, state, fun) //{ - // return first(segmented_fold_until_impl(seq, state, nil, fun)); + // return first(segmented_fold_until_impl(seq, state, nil_, fun)); //} namespace result_of @@ -32,7 +32,7 @@ namespace boost { namespace fusion detail::segmented_fold_until_impl< Sequence , State - , fusion::nil + , fusion::nil_ , Fun > filter; @@ -55,7 +55,7 @@ namespace boost { namespace fusion typename result_of::segmented_fold_until::filter filter; - return filter::call(seq, state, fusion::nil(), fun); + return filter::call(seq, state, fusion::nil_(), fun); } template @@ -66,7 +66,7 @@ namespace boost { namespace fusion typename result_of::segmented_fold_until::filter filter; - return filter::call(seq, state, fusion::nil(), fun); + return filter::call(seq, state, fusion::nil_(), fun); } }} diff --git a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp index 9bf459c4..2e4e0782 100644 --- a/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp +++ b/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp @@ -70,7 +70,7 @@ namespace boost { namespace fusion { namespace detail // switch (size(stack_begin)) // { // case 1: - // return nil; + // return nil_; // case 2: // // car(cdr(stack_begin)) is a range over values. // assert(end(front(car(stack_begin))) == end(car(cdr(stack_begin)))); @@ -205,7 +205,7 @@ namespace boost { namespace fusion { namespace detail template struct make_segment_sequence_front { - typedef typename Stack::cdr_type type; // nil + typedef typename Stack::cdr_type type; // nil_ static type call(Stack const &stack) { @@ -218,7 +218,7 @@ namespace boost { namespace fusion { namespace detail // switch (size(stack_end)) // { // case 1: - // return nil; + // return nil_; // case 2: // // car(cdr(stack_back)) is a range over values. // assert(end(front(car(stack_end))) == end(car(cdr(stack_end)))); @@ -348,7 +348,7 @@ namespace boost { namespace fusion { namespace detail template struct make_segment_sequence_back { - typedef typename Stack::cdr_type type; // nil + typedef typename Stack::cdr_type type; // nil_ static type call(Stack const& stack) {