diff --git a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp index a7961ec3..7bc5fe08 100644 --- a/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp +++ b/include/boost/fusion/adapted/struct/detail/define_struct_inline.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -61,15 +62,20 @@ BOOST_PP_COMMA_IF(N) \ BOOST_FUSION_MAKE_INIT_LIST_ENTRY_I(BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE)) +#define BOOST_FUSION_ITERATOR_NAME(NAME) \ + BOOST_PP_CAT(boost_fusion_detail_, BOOST_PP_CAT(NAME, _iterator)) + // Note: all template parameter names need to be uglified, otherwise they might // shadow a template parameter of the struct when used with // BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE #define BOOST_FUSION_MAKE_ITERATOR_VALUE_OF_SPECS(Z, N, NAME) \ - template \ - struct value_of > \ + template \ + struct value_of< \ + BOOST_FUSION_ITERATOR_NAME(NAME) \ + > \ : boost::mpl::identity< \ - typename boost_fusion_uglified_Sq::t##N##_type \ + typename boost_fusion_detail_Sq::t##N##_type \ > \ { \ }; @@ -77,10 +83,10 @@ #define BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \ SPEC_TYPE, CALL_ARG_TYPE, TYPE_QUAL, ATTRIBUTE, N) \ \ - template \ + template \ struct deref > \ { \ - typedef typename boost_fusion_uglified_Sq::t##N##_type TYPE_QUAL& type; \ + typedef typename boost_fusion_detail_Sq::t##N##_type TYPE_QUAL& type; \ static type call(CALL_ARG_TYPE, N> const& iter) \ { \ return iter.seq_.BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \ @@ -89,48 +95,48 @@ #define BOOST_FUSION_MAKE_ITERATOR_DEREF_SPECS(R, NAME, N, ATTRIBUTE) \ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPEC( \ - BOOST_PP_CAT(NAME, _iterator) \ - struct value_at > \ + template \ + struct value_at > \ { \ - typedef typename boost_fusion_uglified_Sq::t##N##_type type; \ + typedef typename boost_fusion_detail_Sq::t##N##_type type; \ }; #define BOOST_FUSION_MAKE_AT_SPECS(R, DATA, N, ATTRIBUTE) \ - template \ - struct at > \ + template \ + struct at > \ { \ typedef typename boost::mpl::if_< \ - boost::is_const, \ - typename boost_fusion_uglified_Sq::t##N##_type const&, \ - typename boost_fusion_uglified_Sq::t##N##_type& \ + boost::is_const, \ + typename boost_fusion_detail_Sq::t##N##_type const&, \ + typename boost_fusion_detail_Sq::t##N##_type& \ >::type type; \ \ - static type call(boost_fusion_uglified_Sq& sq) \ + static type call(boost_fusion_detail_Sq& sq) \ { \ return sq. BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); \ } \ @@ -142,7 +148,11 @@ #define BOOST_FUSION_MAKE_DATA_MEMBER(R, DATA, N, ATTRIBUTE) \ BOOST_PP_TUPLE_ELEM(2, 0, ATTRIBUTE) BOOST_PP_TUPLE_ELEM(2, 1, ATTRIBUTE); +// Note: We can't nest the iterator inside the struct because we run into +// a MSVC10 bug involving partial specializations of nested templates. + #define BOOST_FUSION_DEFINE_STRUCT_INLINE_IMPL(NAME, ATTRIBUTES) \ + BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR(NAME, ATTRIBUTES) \ struct NAME : boost::fusion::sequence_facade< \ NAME, \ boost::fusion::random_access_traversal_tag \ @@ -154,6 +164,8 @@ #define BOOST_FUSION_DEFINE_TPL_STRUCT_INLINE_IMPL( \ TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES) \ \ + BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR(NAME, ATTRIBUTES) \ + \ template < \ BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL( \ (0)TEMPLATE_PARAMS_SEQ) \ @@ -173,176 +185,201 @@ NAME, \ BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)) +// Note: can't compute BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ) directly because +// ATTRIBUTES_SEQ may be empty and calling BOOST_PP_SEQ_SIZE on an empty +// sequence produces warnings on MSVC. #define BOOST_FUSION_DEFINE_STRUCT_MEMBERS_IMPL(NAME, ATTRIBUTES_SEQ) \ BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \ NAME, \ ATTRIBUTES_SEQ, \ - BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)) + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE((0)ATTRIBUTES_SEQ))) -#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \ +#define BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR(NAME, ATTRIBUTES) \ + BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL( \ + NAME, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END)) + +#define BOOST_FUSION_DEFINE_STRUCT_ITERATOR_IMPL(NAME, ATTRIBUTES_SEQ) \ + BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR_IMPL_IMPL( \ + NAME, \ + ATTRIBUTES_SEQ, \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE((0)ATTRIBUTES_SEQ))) + +#define BOOST_FUSION_DEFINE_STRUCT_INLINE_ITERATOR_IMPL_IMPL( \ NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \ \ - NAME() \ - BOOST_PP_IF( \ - BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \ - BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \ - BOOST_FUSION_IGNORE_1) \ - (ATTRIBUTES_SEQ) \ - { \ - } \ - \ - BOOST_PP_IF( \ - BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \ - BOOST_FUSION_MAKE_COPY_CONSTRUCTOR, \ - BOOST_FUSION_IGNORE_2) \ - (NAME, ATTRIBUTES_SEQ) \ - \ - template \ - NAME(const boost_fusion_uglified_Seq& rhs) \ - { \ - boost::fusion::copy(rhs, *this); \ - } \ - \ - template \ - NAME& operator=(const boost_fusion_uglified_Seq& rhs) \ - { \ - boost::fusion::copy(rhs, *this); \ - return *this; \ - } \ - \ - template \ - struct NAME##_iterator \ + template \ + struct BOOST_FUSION_ITERATOR_NAME(NAME) \ : boost::fusion::iterator_facade< \ - NAME##_iterator, \ + BOOST_FUSION_ITERATOR_NAME(NAME), \ boost::fusion::random_access_traversal_tag \ > \ { \ typedef boost::mpl::int_ index; \ - typedef boost_fusion_uglified_Seq sequence_type; \ + typedef boost_fusion_detail_Seq sequence_type; \ \ - NAME##_iterator(boost_fusion_uglified_Seq& seq) : seq_(seq) {} \ + BOOST_FUSION_ITERATOR_NAME(NAME)(boost_fusion_detail_Seq& seq) \ + : seq_(seq) {} \ \ - boost_fusion_uglified_Seq& seq_; \ + boost_fusion_detail_Seq& seq_; \ \ - template struct value_of; \ + template struct value_of; \ BOOST_PP_REPEAT( \ ATTRIBUTES_SEQ_SIZE, \ BOOST_FUSION_MAKE_ITERATOR_VALUE_OF_SPECS, \ NAME) \ \ - template struct deref; \ + template struct deref; \ BOOST_PP_SEQ_FOR_EACH_I( \ BOOST_FUSION_MAKE_ITERATOR_DEREF_SPECS, \ NAME, \ ATTRIBUTES_SEQ) \ \ - template \ + template \ struct next \ { \ - typedef NAME##_iterator< \ - typename boost_fusion_uglified_It::sequence_type, \ - boost_fusion_uglified_It::index::value + 1 \ + typedef BOOST_FUSION_ITERATOR_NAME(NAME)< \ + typename boost_fusion_detail_It::sequence_type, \ + boost_fusion_detail_It::index::value + 1 \ > type; \ \ - static type call(boost_fusion_uglified_It const& it) \ + static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ } \ }; \ \ - template \ + template \ struct prior \ { \ - typedef NAME##_iterator< \ - typename boost_fusion_uglified_It::sequence_type, \ - boost_fusion_uglified_It::index::value - 1 \ + typedef BOOST_FUSION_ITERATOR_NAME(NAME)< \ + typename boost_fusion_detail_It::sequence_type, \ + boost_fusion_detail_It::index::value - 1 \ > type; \ \ - static type call(boost_fusion_uglified_It const& it) \ + static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ } \ }; \ \ template < \ - typename boost_fusion_uglified_It1, \ - typename boost_fusion_uglified_It2 \ + typename boost_fusion_detail_It1, \ + typename boost_fusion_detail_It2 \ > \ struct distance \ { \ typedef typename boost::mpl::minus< \ - typename boost_fusion_uglified_It2::index, \ - typename boost_fusion_uglified_It1::index \ + typename boost_fusion_detail_It2::index, \ + typename boost_fusion_detail_It1::index \ >::type type; \ \ - static type call(boost_fusion_uglified_It1 const& it1, \ - boost_fusion_uglified_It2 const& it2) \ + static type call(boost_fusion_detail_It1 const& it1, \ + boost_fusion_detail_It2 const& it2) \ { \ return type(); \ } \ }; \ \ template < \ - typename boost_fusion_uglified_It, \ - typename boost_fusion_uglified_M \ + typename boost_fusion_detail_It, \ + typename boost_fusion_detail_M \ > \ struct advance \ { \ - typedef NAME##_iterator< \ - typename boost_fusion_uglified_It::sequence_type, \ - boost_fusion_uglified_It::index::value \ - + boost_fusion_uglified_M::value \ + typedef BOOST_FUSION_ITERATOR_NAME(NAME)< \ + typename boost_fusion_detail_It::sequence_type, \ + boost_fusion_detail_It::index::value \ + + boost_fusion_detail_M::value \ > type; \ \ - static type call(boost_fusion_uglified_It const& it) \ + static type call(boost_fusion_detail_It const& it) \ { \ return type(it.seq_); \ } \ }; \ - }; \ + }; + + +#define BOOST_FUSION_DEFINE_STRUCT_INLINE_MEMBERS_IMPL_IMPL( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTES_SEQ_SIZE) \ \ - template \ + /* Note: second BOOST_PP_IF is necessary to avoid MSVC warning when */ \ + /* calling BOOST_FUSION_IGNORE_1 with no arguments. */ \ + NAME() \ + BOOST_PP_IF( \ + ATTRIBUTES_SEQ_SIZE, \ + BOOST_FUSION_MAKE_DEFAULT_INIT_LIST, \ + BOOST_FUSION_IGNORE_1) \ + (BOOST_PP_IF( \ + ATTRIBUTES_SEQ_SIZE, \ + ATTRIBUTES_SEQ, \ + 0)) \ + { \ + } \ + \ + BOOST_PP_IF( \ + ATTRIBUTES_SEQ_SIZE, \ + BOOST_FUSION_MAKE_COPY_CONSTRUCTOR, \ + BOOST_FUSION_IGNORE_2) \ + (NAME, ATTRIBUTES_SEQ) \ + \ + template \ + NAME(const boost_fusion_detail_Seq& rhs) \ + { \ + boost::fusion::copy(rhs, *this); \ + } \ + \ + template \ + NAME& operator=(const boost_fusion_detail_Seq& rhs) \ + { \ + boost::fusion::copy(rhs, *this); \ + return *this; \ + } \ + \ + template \ struct begin \ { \ - typedef NAME##_iterator type; \ + typedef BOOST_FUSION_ITERATOR_NAME(NAME) \ + type; \ \ - static type call(boost_fusion_uglified_Sq& sq) \ + static type call(boost_fusion_detail_Sq& sq) \ { \ return type(sq); \ } \ }; \ \ - template \ + template \ struct end \ { \ - typedef NAME##_iterator< \ - boost_fusion_uglified_Sq, \ + typedef BOOST_FUSION_ITERATOR_NAME(NAME)< \ + boost_fusion_detail_Sq, \ ATTRIBUTES_SEQ_SIZE \ > type; \ \ - static type call(boost_fusion_uglified_Sq& sq) \ + static type call(boost_fusion_detail_Sq& sq) \ { \ return type(sq); \ } \ }; \ \ - template \ + template \ struct size : boost::mpl::int_ \ { \ }; \ \ - template \ + template \ struct empty : boost::mpl::bool_ \ { \ }; \ \ template < \ - typename boost_fusion_uglified_Sq, \ - typename boost_fusion_uglified_N \ + typename boost_fusion_detail_Sq, \ + typename boost_fusion_detail_N \ > \ struct value_at : value_at< \ - boost_fusion_uglified_Sq, \ - boost::mpl::int_ \ + boost_fusion_detail_Sq, \ + boost::mpl::int_ \ > \ { \ }; \ @@ -353,12 +390,12 @@ ~) \ \ template < \ - typename boost_fusion_uglified_Sq, \ - typename boost_fusion_uglified_N \ + typename boost_fusion_detail_Sq, \ + typename boost_fusion_detail_N \ > \ struct at : at< \ - boost_fusion_uglified_Sq, \ - boost::mpl::int_ \ + boost_fusion_detail_Sq, \ + boost::mpl::int_ \ > \ { \ }; \ diff --git a/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp b/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp index d368338a..c89a7dda 100644 --- a/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/preprocessed/fold.hpp @@ -116,7 +116,7 @@ namespace boost { namespace fusion { template static Result - call(State const& state,It0 const& it0, F) + call(State const& state,It0 const&, F) { return static_cast(state); } diff --git a/include/boost/fusion/algorithm/iteration/detail/preprocessed/reverse_fold.hpp b/include/boost/fusion/algorithm/iteration/detail/preprocessed/reverse_fold.hpp index 71730abf..48a41344 100644 --- a/include/boost/fusion/algorithm/iteration/detail/preprocessed/reverse_fold.hpp +++ b/include/boost/fusion/algorithm/iteration/detail/preprocessed/reverse_fold.hpp @@ -115,7 +115,7 @@ namespace boost { namespace fusion { template static Result - call(State const& state,It0 const& it0, F) + call(State const& state,It0 const&, F) { return static_cast(state); } diff --git a/include/boost/fusion/algorithm/query/detail/any.hpp b/include/boost/fusion/algorithm/query/detail/any.hpp index 42409d5a..5f6b8577 100644 --- a/include/boost/fusion/algorithm/query/detail/any.hpp +++ b/include/boost/fusion/algorithm/query/detail/any.hpp @@ -109,7 +109,7 @@ namespace detail struct unrolled_any<0> { template - static bool call(It const& it, F f) + static bool call(It const&, F) { return false; } diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 215981e4..56ae290e 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -11,24 +11,23 @@ #include /////////////////////////////////////////////////////////////////////////////// -// With no decltype and variadics, we will use the C++03 version +// With variadics, we will use the PP version version /////////////////////////////////////////////////////////////////////////////// -#if (defined(BOOST_NO_DECLTYPE) \ - || defined(BOOST_NO_VARIADIC_TEMPLATES) \ - || defined(BOOST_NO_RVALUE_REFERENCES)) -# include +#if defined(BOOST_NO_VARIADIC_TEMPLATES) +# include #else -# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE) -# define BOOST_FUSION_HAS_CPP11_DEQUE +# if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) +# define BOOST_FUSION_HAS_VARIADIC_DEQUE # endif /////////////////////////////////////////////////////////////////////////////// -// C++11 interface +// C++11 variadic interface /////////////////////////////////////////////////////////////////////////////// #include #include +#include #include -#include +#include #include #include #include @@ -36,8 +35,10 @@ #include #include #include +#include #include +#include #include #include @@ -48,6 +49,22 @@ namespace boost { namespace fusion template struct deque : detail::nil_keyed_element { + typedef deque_tag fusion_tag; + typedef bidirectional_traversal_tag category; + typedef mpl::int_<0> size; + typedef mpl::int_<0> next_up; + typedef mpl::int_<0> next_down; + typedef mpl::false_ is_view; + + template + deque(Sequence const&, + typename enable_if< + mpl::and_< + traits::is_sequence + , result_of::empty>>::type* /*dummy*/ = 0) + {} + + deque() {} }; template @@ -60,7 +77,7 @@ namespace boost { namespace fusion typedef typename detail::deque_keyed_values::type base; typedef mpl::int_<(sizeof ...(Tail) + 1)> size; typedef mpl::int_ next_up; - typedef mpl::int_::type::value> next_down; + typedef mpl::int_<((size::value == 0) ? 0 : -1)> next_down; typedef mpl::false_ is_view; deque() @@ -71,11 +88,45 @@ namespace boost { namespace fusion : base(seq) {} - explicit deque(typename detail::call_param::type head - , typename detail::call_param::type... tail) - : base(detail::deque_keyed_values::call(head, tail...)) + template + deque(deque& seq) + : base(seq) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + deque(deque&& seq) + : base(std::forward>(seq)) + {} +#endif + + deque(deque const& seq) + : base(seq) + {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + deque(deque&& seq) + : base(std::forward(seq)) + {} +#endif + + explicit deque(Head const& head, Tail const&... tail) + : base(detail::deque_keyed_values::construct(head, tail...)) + {} + + template + explicit deque(Head_ const& head, Tail_ const&... tail) + : base(detail::deque_keyed_values::construct(head, tail...)) + {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + explicit deque(Head_&& head, Tail_&&... tail) + : base(detail::deque_keyed_values + ::forward_(std::forward(head), std::forward(tail)...)) + {} +#endif + template explicit deque(Sequence const& seq , typename disable_if >::type* /*dummy*/ = 0) @@ -95,6 +146,16 @@ namespace boost { namespace fusion base::operator=(rhs); return *this; } + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + deque& operator=(T&& rhs) + { + base::operator=(std::forward(rhs)); + return *this; + } +#endif + }; }} diff --git a/include/boost/fusion/container/deque/deque_fwd.hpp b/include/boost/fusion/container/deque/deque_fwd.hpp index 19ca8f8f..fc1f9cbd 100644 --- a/include/boost/fusion/container/deque/deque_fwd.hpp +++ b/include/boost/fusion/container/deque/deque_fwd.hpp @@ -16,10 +16,10 @@ #if (defined(BOOST_NO_DECLTYPE) \ || defined(BOOST_NO_VARIADIC_TEMPLATES) \ || defined(BOOST_NO_RVALUE_REFERENCES)) -# include +# include #else -# if !defined(BOOST_FUSION_HAS_CPP11_DEQUE) -# define BOOST_FUSION_HAS_CPP11_DEQUE +# if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) +# define BOOST_FUSION_HAS_VARIADIC_DEQUE # endif /////////////////////////////////////////////////////////////////////////////// diff --git a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp index b76916eb..44d279f6 100644 --- a/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp +++ b/include/boost/fusion/container/deque/detail/deque_forward_ctor.hpp @@ -9,10 +9,12 @@ #if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212) #define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_FORWARD_CTOR_04122006_2212 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif +#define FUSION_DEQUE_FORWARD_CTOR_FORWARD(z, n, _) std::forward(t##n) + #include #include #include @@ -22,14 +24,22 @@ #define BOOST_PP_ITERATION_LIMITS (2, FUSION_MAX_DEQUE_SIZE) #include BOOST_PP_ITERATE() +#undef FUSION_DEQUE_FORWARD_CTOR_FORWARD #endif #else #define N BOOST_PP_ITERATION() deque(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference::type>::type t)) - : base(detail::deque_keyed_values::call(BOOST_PP_ENUM_PARAMS(N, t))) + : base(detail::deque_keyed_values::construct(BOOST_PP_ENUM_PARAMS(N, t))) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) +deque(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && t)) + : base(detail::deque_keyed_values:: + forward_(BOOST_PP_ENUM(N, FUSION_DEQUE_FORWARD_CTOR_FORWARD, _))) +{} +#endif + #undef N #endif diff --git a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp index edb3c176..21075ef4 100644 --- a/include/boost/fusion/container/deque/detail/deque_initial_size.hpp +++ b/include/boost/fusion/container/deque/detail/deque_initial_size.hpp @@ -8,7 +8,7 @@ #if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139) #define BOOST_FUSION_DEQUE_DETAIL_DEQUE_INITIAL_SIZE_26112006_2139 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif diff --git a/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp b/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp index f95960bc..d457516f 100644 --- a/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp +++ b/include/boost/fusion/container/deque/detail/deque_keyed_values_call.hpp @@ -9,25 +9,30 @@ #if !defined(BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211) #define BOOST_FUSION_SEQUENCE_DEQUE_DETAIL_DEQUE_KEYED_VALUES_CALL_04122006_2211 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif #include #include +#include #include +#define FUSION_DEQUE_KEYED_VALUES_FORWARD(z, n, _) \ + std::forward(BOOST_PP_CAT(t, n)) + #define BOOST_PP_FILENAME_1 \ #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_DEQUE_SIZE) #include BOOST_PP_ITERATE() +#undef FUSION_DEQUE_KEYED_VALUES_FORWARD #endif #else #define N BOOST_PP_ITERATION() - static type call(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference::type>::type t)) + static type construct(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference::type>::type t)) { return type(t0, deque_keyed_values_impl< @@ -38,5 +43,16 @@ >::call(BOOST_PP_ENUM_SHIFTED_PARAMS(N, t))); } + static type forward_(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && t)) + { + return type(std::forward(t0), + deque_keyed_values_impl< + next_index + #if N > 1 + , BOOST_PP_ENUM_SHIFTED_PARAMS(N, T) + #endif + >::forward_(BOOST_PP_ENUM_SHIFTED(N, FUSION_DEQUE_KEYED_VALUES_FORWARD, _))); + } + #undef N #endif diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index d1b219de..e5bdc2ab 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -47,16 +47,42 @@ namespace boost { namespace fusion { namespace detail *it, base::from_iterator(fusion::next(it))); } + keyed_element(keyed_element const& rhs) + : Rest(rhs.get_base()), value_(rhs.value_) + {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + keyed_element(keyed_element&& rhs) + : Rest(std::forward(rhs.forward_base())) + , value_(std::forward(rhs.value_)) + {} +#endif + template keyed_element(keyed_element const& rhs) : Rest(rhs.get_base()), value_(rhs.value_) {} - Rest const get_base() const +#if !defined(BOOST_NO_RVALUE_REFERENCES) +#endif + + Rest& get_base() { return *this; } + Rest const& get_base() const + { + return *this; + } + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + Rest&& forward_base() + { + return std::forward(*static_cast(this)); + } +#endif + typename cref_result::type get(Key) const { return value_; @@ -67,10 +93,19 @@ namespace boost { namespace fusion { namespace detail return value_; } - keyed_element(typename call_param::type value, Rest const& rest) + keyed_element( + typename detail::call_param::type value + , Rest const& rest) : Rest(rest), value_(value) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) + keyed_element(Value&& value, Rest&& rest) + : Rest(std::forward(rest)) + , value_(std::forward(value)) + {} +#endif + keyed_element() : Rest(), value_() {} @@ -90,6 +125,15 @@ namespace boost { namespace fusion { namespace detail return *this; } +#if !defined(BOOST_NO_RVALUE_REFERENCES) + keyed_element& operator=(keyed_element&& rhs) + { + base::operator=(std::forward(rhs)); + value_ = std::forward(rhs.value_); + return *this; + } +#endif + Value value_; }; diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp b/include/boost/fusion/container/deque/detail/pp_deque.hpp similarity index 78% rename from include/boost/fusion/container/deque/detail/cpp03_deque.hpp rename to include/boost/fusion/container/deque/detail/pp_deque.hpp index 5804d890..7913b67b 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp +++ b/include/boost/fusion/container/deque/detail/pp_deque.hpp @@ -5,17 +5,17 @@ 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_CPP03_FUSION_DEQUE_26112006_1649) -#define BOOST_CPP03_FUSION_DEQUE_26112006_1649 +#if !defined(BOOST_PP_FUSION_DEQUE_26112006_1649) +#define BOOST_PP_FUSION_DEQUE_26112006_1649 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif #include #include #include -#include +#include #include #include #include @@ -87,13 +87,34 @@ namespace boost { namespace fusion { : base(t0, detail::nil_keyed_element()) {} + explicit deque(deque const& rhs) + : base(rhs) + {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + explicit deque(T0&& t0) + : base(std::forward(t0), detail::nil_keyed_element()) + {} + + explicit deque(deque&& rhs) + : base(std::forward(rhs)) + {} +#endif + template - deque(deque const& seq) + deque(deque const& seq) : base(seq) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + deque(deque&& seq) + : base(std::forward>(seq)) + {} +#endif + template - deque(Sequence const& seq, typename disable_if >::type* /*dummy*/ = 0) + deque(Sequence const& seq, typename disable_if >::type* /*dummy*/ = 0) : base(base::from_iterator(fusion::begin(seq))) {} @@ -113,6 +134,16 @@ namespace boost { namespace fusion { return *this; } +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + deque& + operator=(T&& rhs) + { + base::operator=(std::forward(rhs)); + return *this; + } +#endif + }; }} diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp b/include/boost/fusion/container/deque/detail/pp_deque_fwd.hpp similarity index 92% rename from include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp rename to include/boost/fusion/container/deque/detail/pp_deque_fwd.hpp index 3a74447b..354cfccd 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp +++ b/include/boost/fusion/container/deque/detail/pp_deque_fwd.hpp @@ -5,10 +5,10 @@ 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(FUSION_CPP03_DEQUE_FORWARD_02092007_0749) -#define FUSION_CPP03_DEQUE_FORWARD_02092007_0749 +#if !defined(FUSION_PP_DEQUE_FORWARD_02092007_0749) +#define FUSION_PP_DEQUE_FORWARD_02092007_0749 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/pp_deque_keyed_values.hpp similarity index 96% rename from include/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp rename to include/boost/fusion/container/deque/detail/pp_deque_keyed_values.hpp index 2fee4700..a7c4939a 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/pp_deque_keyed_values.hpp @@ -8,7 +8,7 @@ #if !defined(BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330) #define BOOST_FUSION_DEQUE_DETAIL_DEQUE_KEYED_VALUES_26112006_1330 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif @@ -72,6 +72,11 @@ namespace boost { namespace fusion { namespace detail { return type(); } + + static type forward_() + { + return type(); + } }; template diff --git a/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/variadic_deque_keyed_values.hpp similarity index 76% rename from include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp rename to include/boost/fusion/container/deque/detail/variadic_deque_keyed_values.hpp index 43ed5360..aae26a5b 100644 --- a/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/variadic_deque_keyed_values.hpp @@ -28,13 +28,23 @@ namespace boost { namespace fusion { namespace detail typedef typename deque_keyed_values_impl::type tail; typedef keyed_element type; - static type call( + static type construct( typename detail::call_param::type head , typename detail::call_param::type... tail) { return type( head - , deque_keyed_values_impl::call(tail...) + , deque_keyed_values_impl::construct(tail...) + ); + } + + template + static type forward_(Head_&& head, Tail_&&... tail) + { + return type( + std::forward(head) + , deque_keyed_values_impl:: + forward_(std::forward(tail)...) ); } }; @@ -45,7 +55,8 @@ namespace boost { namespace fusion { namespace detail struct deque_keyed_values_impl { typedef nil_keyed_element type; - static type call() { return type(); } + static type construct() { return type(); } + static type forward_() { return type(); } }; template diff --git a/include/boost/fusion/container/deque/limits.hpp b/include/boost/fusion/container/deque/limits.hpp index 2a7d219d..7892ba1a 100644 --- a/include/boost/fusion/container/deque/limits.hpp +++ b/include/boost/fusion/container/deque/limits.hpp @@ -8,7 +8,7 @@ #if !defined(BOOST_FUSION_DEQUE_LIMITS_26112006_1737) #define BOOST_FUSION_DEQUE_LIMITS_26112006_1737 -#if defined(BOOST_FUSION_HAS_CPP11_DEQUE) +#if defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) #error "C++03 only! This file should not have been included" #endif diff --git a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp index 92f7aa6c..c41d5b29 100644 --- a/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp +++ b/include/boost/fusion/container/vector/detail/vector_forward_ctor.hpp @@ -12,11 +12,14 @@ #include #include +#define FUSION_FORWARD_CTOR_MOVE(z, n, _) std::move(_##n) + #define BOOST_PP_FILENAME_1 \ #define BOOST_PP_ITERATION_LIMITS (1, FUSION_MAX_VECTOR_SIZE) #include BOOST_PP_ITERATE() +#undef FUSION_FORWARD_CTOR_MOVE #endif #else // defined(BOOST_PP_IS_ITERATING) /////////////////////////////////////////////////////////////////////////////// @@ -34,6 +37,14 @@ N, typename detail::call_param::type _)) : vec(BOOST_PP_ENUM_PARAMS(N, _)) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) +#if N == 1 + explicit +#endif + vector(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _)) + : vec(BOOST_PP_ENUM(N, FUSION_FORWARD_CTOR_MOVE, _)) {} +#endif + #undef N #endif // defined(BOOST_PP_IS_ITERATING) diff --git a/include/boost/fusion/container/vector/detail/vector_n.hpp b/include/boost/fusion/container/vector/detail/vector_n.hpp index 4e249c7f..539b47fa 100644 --- a/include/boost/fusion/container/vector/detail/vector_n.hpp +++ b/include/boost/fusion/container/vector/detail/vector_n.hpp @@ -9,24 +9,31 @@ #if !defined(FUSION_MACRO_05042005) #define FUSION_MACRO_05042005 -#define FUSION_MEMBER_DEFAULT_INIT(z, n, _) m##n() -#define FUSION_MEMBER_INIT(z, n, _) m##n(_##n) -#define FUSION_COPY_INIT(z, n, _) m##n(other.m##n) -#define FUSION_MEMBER_DECL(z, n, _) T##n m##n; +#define FUSION_VECTOR_MEMBER_MEMBER_DEFAULT_INIT(z, n, _) m##n() +#define FUSION_VECTOR_MEMBER_MEMBER_INIT(z, n, _) m##n(_##n) +#define FUSION_VECTOR_MEMBER_COPY_INIT(z, n, _) m##n(other.m##n) +#define FUSION_VECTOR_MEMBER_FWD(z, n, _) m##n(std::forward(other.m##n)) +#define FUSION_VECTOR_ARG_FWD(z, n, _) m##n(std::forward(_##n)) +#define FUSION_VECTOR_MEMBER_MEMBER_DECL(z, n, _) T##n m##n; +#define FUSION_VECTOR_MEMBER_FORWARD(z, n, _) std::forward(_##n) -#define FUSION_MEMBER_ASSIGN(z, n, _) \ +#define FUSION_VECTOR_MEMBER_MEMBER_ASSIGN(z, n, _) \ this->BOOST_PP_CAT(m, n) = vec.BOOST_PP_CAT(m, n); -#define FUSION_DEREF_MEMBER_ASSIGN(z, n, _) \ +#define FUSION_VECTOR_MEMBER_DEREF_MEMBER_ASSIGN(z, n, _) \ this->BOOST_PP_CAT(m, n) = *BOOST_PP_CAT(i, n); -#define FUSION_AT_IMPL(z, n, _) \ +#define FUSION_VECTOR_MEMBER_MEMBER_FORWARD(z, n, _) \ + this->BOOST_PP_CAT(m, n) = std::forward< \ + BOOST_PP_CAT(T, n)>(vec.BOOST_PP_CAT(m, n)); + +#define FUSION_VECTOR_MEMBER_AT_IMPL(z, n, _) \ typename add_reference::type \ at_impl(mpl::int_) { return this->m##n; } \ typename add_reference::type>::type \ at_impl(mpl::int_) const { return this->m##n; } -#define FUSION_ITER_DECL_VAR(z, n, _) \ +#define FUSION_VECTOR_MEMBER_ITER_DECL_VAR(z, n, _) \ typedef typename result_of::next< \ BOOST_PP_CAT(I, BOOST_PP_DEC(n))>::type BOOST_PP_CAT(I, n); \ BOOST_PP_CAT(I, n) BOOST_PP_CAT(i, n) \ @@ -40,21 +47,32 @@ struct BOOST_PP_CAT(vector_data, N) { BOOST_PP_CAT(vector_data, N)() - : BOOST_PP_ENUM(N, FUSION_MEMBER_DEFAULT_INIT, _) {} + : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_MEMBER_DEFAULT_INIT, _) {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _)) + : BOOST_PP_ENUM(N, FUSION_VECTOR_ARG_FWD, _) {} +#endif BOOST_PP_CAT(vector_data, N)( BOOST_PP_ENUM_BINARY_PARAMS( N, typename detail::call_param::type _)) - : BOOST_PP_ENUM(N, FUSION_MEMBER_INIT, _) {} + : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_MEMBER_INIT, _) {} BOOST_PP_CAT(vector_data, N)( BOOST_PP_CAT(vector_data, N) const& other) - : BOOST_PP_ENUM(N, FUSION_COPY_INIT, _) {} + : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_COPY_INIT, _) {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + BOOST_PP_CAT(vector_data, N)( + BOOST_PP_CAT(vector_data, N)&& other) + : BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FWD, _) {} +#endif BOOST_PP_CAT(vector_data, N)& operator=(BOOST_PP_CAT(vector_data, N) const& vec) { - BOOST_PP_REPEAT(N, FUSION_MEMBER_ASSIGN, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_ASSIGN, _) return *this; } @@ -64,7 +82,7 @@ { typedef typename result_of::begin::type I0; I0 i0 = fusion::begin(seq); - BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) + BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); } @@ -74,11 +92,11 @@ { typedef typename result_of::begin::type I0; I0 i0 = fusion::begin(seq); - BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) + BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) return BOOST_PP_CAT(vector_data, N)(BOOST_PP_ENUM_PARAMS(N, *i)); } - BOOST_PP_REPEAT(N, FUSION_MEMBER_DECL, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_DECL, _) }; template @@ -105,6 +123,19 @@ N, typename detail::call_param::type _)) : base_type(BOOST_PP_ENUM_PARAMS(N, _)) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) +#if (N == 1) + explicit +#endif + BOOST_PP_CAT(vector, N)(BOOST_PP_ENUM_BINARY_PARAMS(N, T, && _)) + : base_type(BOOST_PP_ENUM(N, FUSION_VECTOR_MEMBER_FORWARD, _)) {} +#endif + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + BOOST_PP_CAT(vector, N)(BOOST_PP_CAT(vector, N)&& rhs) + : base_type(std::forward(rhs)) {} +#endif + template BOOST_PP_CAT(vector, N)( BOOST_PP_CAT(vector, N) const& vec) @@ -132,7 +163,7 @@ BOOST_PP_CAT(vector, N)& operator=(BOOST_PP_CAT(vector, N) const& vec) { - BOOST_PP_REPEAT(N, FUSION_MEMBER_ASSIGN, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_ASSIGN, _) return *this; } @@ -142,12 +173,21 @@ { typedef typename result_of::begin::type I0; I0 i0 = fusion::begin(seq); - BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_ITER_DECL_VAR, _) - BOOST_PP_REPEAT(N, FUSION_DEREF_MEMBER_ASSIGN, _) + BOOST_PP_REPEAT_FROM_TO(1, N, FUSION_VECTOR_MEMBER_ITER_DECL_VAR, _) + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_DEREF_MEMBER_ASSIGN, _) return *this; } - BOOST_PP_REPEAT(N, FUSION_AT_IMPL, _) +#if !defined(BOOST_NO_RVALUE_REFERENCES) + BOOST_PP_CAT(vector, N)& + operator=(BOOST_PP_CAT(vector, N)&& vec) + { + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_MEMBER_FORWARD, _) + return *this; + } +#endif + + BOOST_PP_REPEAT(N, FUSION_VECTOR_MEMBER_AT_IMPL, _) template typename add_reference::type>::type @@ -166,3 +206,4 @@ #undef N + diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index 6563bc93..36c1b7ac 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -106,6 +106,11 @@ namespace boost { namespace fusion vector(vector const& rhs) : vec(rhs.vec) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) + vector(vector&& rhs) + : vec(std::forward(rhs.vec)) {} +#endif + template vector(Sequence const& rhs) : vec(BOOST_FUSION_VECTOR_COPY_INIT()) {} @@ -135,6 +140,23 @@ namespace boost { namespace fusion return *this; } +#if !defined(BOOST_NO_RVALUE_REFERENCES) + vector& + operator=(vector&& rhs) + { + vec = std::forward(rhs.vec); + return *this; + } + + template + vector& + operator=(T&& rhs) + { + vec = std::forward(rhs); + return *this; + } +#endif + template typename add_reference< typename mpl::at_c::type diff --git a/include/boost/fusion/functional/invocation/invoke.hpp b/include/boost/fusion/functional/invocation/invoke.hpp index 085beb7e..1a491702 100644 --- a/include/boost/fusion/functional/invocation/invoke.hpp +++ b/include/boost/fusion/functional/invocation/invoke.hpp @@ -57,13 +57,13 @@ namespace boost { namespace fusion template struct invoke; } - template - inline typename result_of::invoke::type - invoke(Function, Sequence &); + //~ template + //~ inline typename result_of::invoke::type + //~ invoke(Function, Sequence &); - template - inline typename result_of::invoke::type - invoke(Function, Sequence const &); + //~ template + //~ inline typename result_of::invoke::type + //~ invoke(Function, Sequence const &); //----- ---- --- -- - - - - @@ -85,6 +85,9 @@ namespace boost { namespace fusion template struct invoke_data_member; + template + struct invoke_fn_ptr; + template struct invoke_mem_fn; @@ -95,10 +98,10 @@ namespace boost { namespace fusion template struct invoke_nonmember_builtin // use same implementation as for function objects but... - : invoke_impl< // ...work around boost::result_of bugs + : invoke_fn_ptr< // ...work around boost::result_of bugs typename mpl::eval_if< ft::is_function, boost::add_reference, boost::remove_cv >::type, - Sequence, N, false, RandomAccess > + Sequence, N, RandomAccess > { }; template @@ -199,6 +202,35 @@ namespace boost { namespace fusion Function(BOOST_PP_ENUM(N,M,~)) >::type result_type; #undef M +#if N > 0 + + template + static inline result_type + call(F & f, Sequence & s) + { +#define M(z,j,data) fusion::at_c(s) + return f( BOOST_PP_ENUM(N,M,~) ); + } + +#else + template + static inline result_type + call(F & f, Sequence & /*s*/) + { + return f(); + } + +#endif + + }; + + template + struct invoke_fn_ptr + { + public: + + typedef typename ft::result_type::type result_type; + #if N > 0 template @@ -278,6 +310,39 @@ namespace boost { namespace fusion return f(); } +#endif + + }; + + template + struct invoke_fn_ptr + { + private: + typedef invoke_param_types seq; + public: + + typedef typename ft::result_type::type result_type; + +#if N > 0 + + template + static inline result_type + call(F & f, Sequence & s) + { + typename seq::I0 i0 = fusion::begin(s); + BOOST_PP_REPEAT_FROM_TO(1,N,M,~) + return f( BOOST_PP_ENUM_PARAMS(N,*i) ); + } + +#else + + template + static inline result_type + call(F & f, Sequence & /*s*/) + { + return f(); + } + #endif }; diff --git a/include/boost/fusion/iterator/iterator_adapter.hpp b/include/boost/fusion/iterator/iterator_adapter.hpp index 68056269..9077f8fa 100644 --- a/include/boost/fusion/iterator/iterator_adapter.hpp +++ b/include/boost/fusion/iterator/iterator_adapter.hpp @@ -23,8 +23,8 @@ namespace boost { namespace fusion iterator_base_type; iterator_base_type iterator_base; - iterator_adapter(iterator_base_type const& iterator_base) - : iterator_base(iterator_base) {} + iterator_adapter(iterator_base_type const& iterator_base_) + : iterator_base(iterator_base_) {} // default implementation template diff --git a/include/boost/fusion/sequence/intrinsic/has_key.hpp b/include/boost/fusion/sequence/intrinsic/has_key.hpp index 1ff05bad..9e0969a9 100644 --- a/include/boost/fusion/sequence/intrinsic/has_key.hpp +++ b/include/boost/fusion/sequence/intrinsic/has_key.hpp @@ -68,7 +68,7 @@ namespace boost { namespace fusion template inline typename result_of::has_key::type - has_key(Sequence const& seq) + has_key(Sequence const&) { typedef typename result_of::has_key::type result; return result();