Merging 77932-78199 from trunk

[SVN r78200]
This commit is contained in:
Joel de Guzman
2012-04-26 00:18:51 +00:00
parent b159898a47
commit 93477e270e
14 changed files with 281 additions and 127 deletions

View File

@ -9,7 +9,7 @@
#include <tuple> #include <tuple>
#include <utility> #include <utility>
#include <boost/mpl/eval_if.hpp> #include <boost/mpl/if.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_const.hpp>
@ -29,13 +29,13 @@ namespace boost { namespace fusion
struct apply struct apply
{ {
typedef typename remove_const<Sequence>::type seq_type; typedef typename remove_const<Sequence>::type seq_type;
typedef std::tuple_element<N::value, seq_type> element; typedef typename std::tuple_element<N::value, seq_type>::type element;
typedef typename typedef typename
mpl::eval_if< mpl::if_<
is_const<Sequence> is_const<Sequence>
, fusion::detail::cref_result<element> , typename fusion::detail::cref_result<element>::type
, fusion::detail::ref_result<element> , typename fusion::detail::ref_result<element>::type
>::type >::type
type; type;

View File

@ -12,7 +12,7 @@
#include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_const.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/mpl/int.hpp> #include <boost/mpl/int.hpp>
#include <boost/mpl/eval_if.hpp> #include <boost/mpl/if.hpp>
#include <tuple> #include <tuple>
#include <utility> #include <utility>
@ -48,12 +48,12 @@ namespace boost { namespace fusion
template <typename Iterator> template <typename Iterator>
struct deref struct deref
{ {
typedef value_of<Iterator> element; typedef typename value_of<Iterator>::type element;
typedef typename typedef typename
mpl::eval_if< mpl::if_<
is_const<typename Iterator::tuple_type> is_const<typename Iterator::tuple_type>
, fusion::detail::cref_result<element> , typename fusion::detail::cref_result<element>::type
, fusion::detail::ref_result<element> , typename fusion::detail::ref_result<element>::type
>::type >::type
type; type;

View File

@ -10,12 +10,6 @@
#include <tuple> #include <tuple>
#include <boost/fusion/support/tag_of_fwd.hpp> #include <boost/fusion/support/tag_of_fwd.hpp>
namespace std
{
template <typename... Elements>
class tuple;
}
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
struct std_tuple_tag; struct std_tuple_tag;

View File

@ -22,6 +22,25 @@
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_convertible.hpp>
///////////////////////////////////////////////////////////////////////////////
// With no decltype and variadics, we will use the C++03 version
///////////////////////////////////////////////////////////////////////////////
#if (defined(BOOST_NO_DECLTYPE) \
|| defined(BOOST_NO_VARIADIC_TEMPLATES) \
|| defined(BOOST_NO_RVALUE_REFERENCES))
# include <boost/fusion/container/deque/detail/cpp03_deque.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
#endif
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp>
#include <boost/fusion/container/deque/deque_fwd.hpp> #include <boost/fusion/container/deque/deque_fwd.hpp>
#include <boost/fusion/container/deque/detail/value_at_impl.hpp> #include <boost/fusion/container/deque/detail/value_at_impl.hpp>
#include <boost/fusion/container/deque/detail/at_impl.hpp> #include <boost/fusion/container/deque/detail/at_impl.hpp>
@ -29,93 +48,67 @@
#include <boost/fusion/container/deque/detail/end_impl.hpp> #include <boost/fusion/container/deque/detail/end_impl.hpp>
#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp> #include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp> #include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/sequence_base.hpp> #include <boost/mpl/int.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/utility/enable_if.hpp> #include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_convertible.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) namespace boost { namespace fusion
#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp> {
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
namespace boost { namespace fusion {
struct deque_tag; struct deque_tag;
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)> template <typename ...Elements>
struct deque struct deque : detail::nil_keyed_element
: {
detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type, };
sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
template <typename Head, typename ...Tail>
struct deque<Head, Tail...>
: detail::deque_keyed_values<Head, Tail...>::type
, sequence_base<deque<Head, Tail...>>
{ {
typedef deque_tag fusion_tag; typedef deque_tag fusion_tag;
typedef bidirectional_traversal_tag category; typedef bidirectional_traversal_tag category;
typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base; typedef typename detail::deque_keyed_values<Head, Tail...>::type base;
typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size; typedef mpl::int_<(sizeof ...(Tail) + 1)> size;
typedef mpl::int_<size::value> next_up; typedef mpl::int_<size::value> next_up;
typedef mpl::int_< typedef mpl::int_<mpl::int_<((size::value == 0) ? 0 : -1)>::type::value> next_down;
mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
typedef mpl::false_ is_view; typedef mpl::false_ is_view;
#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
deque() deque()
{} {}
explicit deque(typename add_reference<typename add_const<T0>::type>::type t0) template <typename ...Elements>
: base(t0, detail::nil_keyed_element()) deque(deque<Elements...> const& seq)
{} : base(seq)
{}
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)> explicit deque(typename detail::call_param<Head>::type head
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq) , typename detail::call_param<Tail>::type... tail)
: base(seq) : base(detail::deque_keyed_values<Head, Tail...>::call(head, tail...))
{} {}
template<typename Sequence> template <typename Sequence>
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0) explicit deque(Sequence const& seq
: base(base::from_iterator(fusion::begin(seq))) , typename disable_if<is_convertible<Sequence, Head> >::type* /*dummy*/ = 0)
{} : base(base::from_iterator(fusion::begin(seq)))
{}
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)> template <typename ...Elements>
deque& deque& operator=(deque<Elements...> const& rhs)
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
{ {
base::operator=(rhs); base::operator=(rhs);
return *this; return *this;
} }
template <typename T> template <typename T>
deque& deque& operator=(T const& rhs)
operator=(T const& rhs)
{ {
base::operator=(rhs); base::operator=(rhs);
return *this; return *this;
} }
}; };
}} }}
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif #endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#endif #endif

View File

@ -11,40 +11,26 @@
#include <boost/fusion/container/deque/limits.hpp> #include <boost/fusion/container/deque/limits.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES) ///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp> // With no decltype and variadics, we will use the C++03 version
///////////////////////////////////////////////////////////////////////////////
#if (defined(BOOST_NO_DECLTYPE) \
|| defined(BOOST_NO_VARIADIC_TEMPLATES) \
|| defined(BOOST_NO_RVALUE_REFERENCES))
# include <boost/fusion/container/deque/detail/cpp03_deque_fwd.hpp>
#else #else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES) #if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp") #pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
#endif #endif
/*============================================================================= ///////////////////////////////////////////////////////////////////////////////
Copyright (c) 2001-2011 Joel de Guzman // C++11 interface
///////////////////////////////////////////////////////////////////////////////
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)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
struct void_; template <typename ...T>
template<
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
FUSION_MAX_DEQUE_SIZE, typename T, void_)>
struct deque; struct deque;
}} }}
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif #endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#endif #endif

View File

@ -0,0 +1,125 @@
/*=============================================================================
Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2006 Dan Marsden
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_FUSION_HAS_CPP11_DEQUE)
#error "C++03 only! This file should not have been included"
#endif
#include <boost/fusion/container/deque/limits.hpp>
#include <boost/fusion/container/deque/front_extended_deque.hpp>
#include <boost/fusion/container/deque/back_extended_deque.hpp>
#include <boost/fusion/container/deque/detail/cpp03_deque_keyed_values.hpp>
#include <boost/fusion/container/deque/detail/deque_initial_size.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/fusion/container/deque/deque_fwd.hpp>
#include <boost/fusion/container/deque/detail/value_at_impl.hpp>
#include <boost/fusion/container/deque/detail/at_impl.hpp>
#include <boost/fusion/container/deque/detail/begin_impl.hpp>
#include <boost/fusion/container/deque/detail/end_impl.hpp>
#include <boost/fusion/container/deque/detail/is_sequence_impl.hpp>
#include <boost/fusion/sequence/intrinsic/begin.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/utility/enable_if.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/container/deque/detail/preprocessed/deque.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR ".hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
namespace boost { namespace fusion {
struct deque_tag;
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename T)>
struct deque
:
detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type,
sequence_base<deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)> >
{
typedef deque_tag fusion_tag;
typedef bidirectional_traversal_tag category;
typedef typename detail::deque_keyed_values<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type base;
typedef typename detail::deque_initial_size<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, T)>::type size;
typedef mpl::int_<size::value> next_up;
typedef mpl::int_<
mpl::if_<mpl::equal_to<size, mpl::int_<0> >, mpl::int_<0>, mpl::int_<-1> >::type::value> next_down;
typedef mpl::false_ is_view;
#include <boost/fusion/container/deque/detail/deque_forward_ctor.hpp>
deque()
{}
explicit deque(typename add_reference<typename add_const<T0>::type>::type t0)
: base(t0, detail::nil_keyed_element())
{}
template<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
deque(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& seq)
: base(seq)
{}
template<typename Sequence>
deque(Sequence const& seq, typename disable_if<is_convertible<Sequence, T0> >::type* /*dummy*/ = 0)
: base(base::from_iterator(fusion::begin(seq)))
{}
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
deque&
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)> const& rhs)
{
base::operator=(rhs);
return *this;
}
template <typename T>
deque&
operator=(T const& rhs)
{
base::operator=(rhs);
return *this;
}
};
}}
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#endif

View File

@ -0,0 +1,54 @@
/*=============================================================================
Copyright (c) 2005-2012 Joel de Guzman
Copyright (c) 2005-2007 Dan Marsden
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(BOOST_FUSION_HAS_CPP11_DEQUE)
#error "C++03 only! This file should not have been included"
#endif
#include <boost/fusion/container/deque/limits.hpp>
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
#if !defined(BOOST_FUSION_DONT_USE_PREPROCESSED_FILES)
#include <boost/fusion/container/deque/detail/preprocessed/deque_fwd.hpp>
#else
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "detail/preprocessed/deque" FUSION_MAX_DEQUE_SIZE_STR "_fwd.hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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)
This is an auto-generated file. Do not edit!
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
namespace boost { namespace fusion
{
struct void_;
template<
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
FUSION_MAX_DEQUE_SIZE, typename T, void_)>
struct deque;
}}
#if defined(__WAVE__) && defined(BOOST_FUSION_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif // BOOST_FUSION_DONT_USE_PREPROCESSED_FILES
#endif

View File

@ -8,9 +8,7 @@
#if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330) #if !defined(BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
#define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330 #define BOOST_FUSION_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330
#include <boost/type_traits/add_reference.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/add_const.hpp>
#include <boost/fusion/iterator/deref.hpp> #include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/iterator/next.hpp> #include <boost/fusion/iterator/next.hpp>
@ -59,17 +57,17 @@ namespace detail {
return *this; return *this;
} }
typename add_reference<typename add_const<Value>::type>::type get(Key) const typename cref_result<Value>::type get(Key) const
{ {
return value_; return value_;
} }
typename add_reference<Value>::type get(Key) typename ref_result<Value>::type get(Key)
{ {
return value_; return value_;
} }
keyed_element(typename add_reference<typename add_const<Value>::type>::type value, Rest const& rest) keyed_element(typename call_param<Value>::type value, Rest const& rest)
: Rest(rest), value_(value) : Rest(rest), value_(value)
{} {}

View File

@ -10,7 +10,7 @@
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
#include <boost/mpl/eval_if.hpp> #include <boost/mpl/if.hpp>
#include <boost/mpl/bool.hpp> #include <boost/mpl/bool.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
@ -93,15 +93,15 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply struct apply
{ {
typedef detail::cons_deref< typedef typename detail::cons_deref<
typename detail::cons_advance<Sequence, N::value>::type> typename detail::cons_advance<Sequence, N::value>::type>::type
element; element;
typedef typename typedef typename
mpl::eval_if< mpl::if_<
is_const<Sequence> is_const<Sequence>
, detail::cref_result<element> , typename detail::cref_result<element>::type
, detail::ref_result<element> , typename detail::ref_result<element>::type
>::type >::type
type; type;

View File

@ -28,7 +28,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply struct apply
{ {
typedef mpl::at<typename Sequence::storage_type::types, N> element; typedef typename
mpl::at<typename Sequence::storage_type::types, N>::type
element;
typedef typename detail::ref_result<element>::type type; typedef typename detail::ref_result<element>::type type;
static type static type
@ -41,7 +43,9 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply <Sequence const, N> struct apply <Sequence const, N>
{ {
typedef mpl::at<typename Sequence::storage_type::types, N> element; typedef typename
mpl::at<typename Sequence::storage_type::types, N>::type
element;
typedef typename detail::cref_result<element>::type type; typedef typename detail::cref_result<element>::type type;
static type static type

View File

@ -12,8 +12,7 @@
#include <boost/fusion/iterator/deref.hpp> #include <boost/fusion/iterator/deref.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/eval_if.hpp> #include <boost/mpl/if.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace fusion { namespace extension namespace boost { namespace fusion { namespace extension
{ {
@ -29,10 +28,10 @@ namespace boost { namespace fusion { namespace extension
typedef typename result_of::value_of<It>::type::second_type data; typedef typename result_of::value_of<It>::type::second_type data;
typedef typename typedef typename
mpl::eval_if< mpl::if_<
is_const<typename It::seq_type> is_const<typename It::seq_type>
, detail::cref_result<mpl::identity<data> > , typename detail::cref_result<data>::type
, detail::ref_result<mpl::identity<data> > , typename detail::ref_result<data>::type
>::type >::type
type; type;

View File

@ -27,7 +27,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply struct apply
{ {
typedef mpl::at<typename Sequence::types, N> element; typedef typename mpl::at<typename Sequence::types, N>::type element;
typedef typename detail::ref_result<element>::type type; typedef typename detail::ref_result<element>::type type;
static type static type
@ -40,7 +40,7 @@ namespace boost { namespace fusion
template <typename Sequence, typename N> template <typename Sequence, typename N>
struct apply <Sequence const, N> struct apply <Sequence const, N>
{ {
typedef mpl::at<typename Sequence::types, N> element; typedef typename mpl::at<typename Sequence::types, N>::type element;
typedef typename detail::cref_result<element>::type type; typedef typename detail::cref_result<element>::type type;
static type static type

View File

@ -10,6 +10,7 @@
#include <boost/mpl/at.hpp> #include <boost/mpl/at.hpp>
#include <boost/fusion/support/detail/access.hpp> #include <boost/fusion/support/detail/access.hpp>
#include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_const.hpp>
#include <boost/mpl/if.hpp>
namespace boost { namespace fusion namespace boost { namespace fusion
{ {
@ -29,14 +30,14 @@ namespace boost { namespace fusion
typedef typename Iterator::vector vector; typedef typename Iterator::vector vector;
typedef typename Iterator::index index; typedef typename Iterator::index index;
typedef typename mpl::at< typedef typename mpl::at<
typename vector::types, index> typename vector::types, index>::type
element; element;
typedef typename typedef typename
mpl::eval_if< mpl::if_<
is_const<vector> is_const<vector>
, fusion::detail::cref_result<element> , typename fusion::detail::cref_result<element>::type
, fusion::detail::ref_result<element> , typename fusion::detail::ref_result<element>::type
>::type >::type
type; type;

View File

@ -15,7 +15,7 @@ namespace boost { namespace fusion { namespace detail
template <typename T> template <typename T>
struct ref_result struct ref_result
{ {
typedef typename add_reference<typename T::type>::type type; typedef typename add_reference<T>::type type;
}; };
template <typename T> template <typename T>
@ -23,7 +23,7 @@ namespace boost { namespace fusion { namespace detail
{ {
typedef typename typedef typename
add_reference< add_reference<
typename add_const<typename T::type>::type typename add_const<T>::type
>::type >::type
type; type;
}; };