mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-29 03:57:36 +02:00
c++ port of deque underway
[SVN r77808]
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
#define BOOST_FUSION_SEQUENCE_CONTAINER_DEQUE_24112006_2036
|
||||
|
||||
#include <boost/fusion/container/deque/deque.hpp>
|
||||
#include <boost/fusion/container/deque/convert.hpp>
|
||||
//#include <boost/fusion/container/deque/convert.hpp>
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -14,11 +14,12 @@
|
||||
#include <boost/fusion/support/sequence_base.hpp>
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
template<typename Deque, typename T>
|
||||
struct back_extended_deque
|
||||
: detail::keyed_element<typename Deque::next_up, T, Deque>,
|
||||
sequence_base<back_extended_deque<Deque, T> >
|
||||
: detail::keyed_element<typename Deque::next_up, T, Deque>
|
||||
, sequence_base<back_extended_deque<Deque, T> >
|
||||
{
|
||||
typedef detail::keyed_element<typename Deque::next_up, T, Deque> base;
|
||||
typedef typename Deque::next_down next_down;
|
||||
|
@ -13,7 +13,7 @@
|
||||
|| defined(BOOST_NO_RVALUE_REFERENCES))
|
||||
# include <boost/fusion/container/deque/cpp03_deque.hpp>
|
||||
#else
|
||||
# include <boost/fusion/container/deque/cpp03_deque.hpp>
|
||||
# include <boost/fusion/container/deque/cpp11_deque.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -15,7 +15,7 @@
|
||||
|| defined(BOOST_NO_RVALUE_REFERENCES))
|
||||
# include <boost/fusion/container/deque/cpp03_deque_fwd.hpp>
|
||||
#else
|
||||
# include <boost/fusion/container/deque/cpp03_deque_fwd.hpp>
|
||||
# include <boost/fusion/container/deque/cpp11_deque_fwd.hpp>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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_DEQUE_ITERATOR_26112006_2154)
|
||||
@ -12,13 +12,13 @@
|
||||
#include <boost/fusion/container/deque/detail/keyed_element.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct bidirectional_traversal_tag;
|
||||
|
||||
template<typename Seq, int Pos>
|
||||
template <typename Seq, int Pos>
|
||||
struct deque_iterator
|
||||
: iterator_facade<deque_iterator<Seq, Pos>, bidirectional_traversal_tag>
|
||||
{
|
||||
@ -84,7 +84,7 @@ namespace boost { namespace fusion {
|
||||
typedef typename
|
||||
mpl::minus<
|
||||
typename I2::index, typename I1::index
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type
|
||||
|
@ -2,7 +2,7 @@
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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_DEQUE_AT_IMPL_09122006_2017)
|
||||
@ -19,15 +19,15 @@
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct deque_tag;
|
||||
|
||||
namespace extension
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct at_impl;
|
||||
|
||||
|
||||
template<>
|
||||
struct at_impl<deque_tag>
|
||||
{
|
||||
@ -37,10 +37,13 @@ namespace boost { namespace fusion {
|
||||
typedef typename Sequence::next_up next_up;
|
||||
typedef typename Sequence::next_down next_down;
|
||||
BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
|
||||
|
||||
typedef mpl::plus<next_down, mpl::int_<1> > offset;
|
||||
typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
|
||||
typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type element_type;
|
||||
|
||||
static int const offset = next_down::value + 1;
|
||||
typedef mpl::int_<(N::value + offset)> adjusted_index;
|
||||
typedef typename
|
||||
detail::keyed_element_value_at<Sequence, adjusted_index>::type
|
||||
element_type;
|
||||
|
||||
typedef typename add_reference<
|
||||
typename mpl::eval_if<
|
||||
is_const<Sequence>,
|
||||
|
@ -2,7 +2,7 @@
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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_DEQUE_BEGIN_IMPL_09122006_2034)
|
||||
@ -13,27 +13,29 @@
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct deque_tag;
|
||||
|
||||
namespace extension
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct begin_impl;
|
||||
|
||||
|
||||
template<>
|
||||
struct begin_impl<deque_tag>
|
||||
{
|
||||
template<typename Sequence>
|
||||
struct apply
|
||||
{
|
||||
typedef typename mpl::if_<
|
||||
mpl::equal_to<typename Sequence::next_down, typename Sequence::next_up>,
|
||||
deque_iterator<Sequence, 0>,
|
||||
deque_iterator<
|
||||
Sequence, mpl::plus<typename Sequence::next_down, mpl::int_<1> >::value> >::type type;
|
||||
|
||||
typedef typename
|
||||
mpl::if_c<
|
||||
(Sequence::next_down::value == Sequence::next_up::value)
|
||||
, deque_iterator<Sequence, 0>
|
||||
, deque_iterator<Sequence, (Sequence::next_down::value + 1)>
|
||||
>::type
|
||||
type;
|
||||
|
||||
static type call(Sequence& seq)
|
||||
{
|
||||
return type(seq);
|
||||
|
@ -2,7 +2,7 @@
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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_DEQUE_DETAIL_KEYED_ELEMENT_26112006_1330)
|
||||
@ -26,7 +26,7 @@ namespace detail {
|
||||
void get();
|
||||
|
||||
template<typename It>
|
||||
static nil_keyed_element
|
||||
static nil_keyed_element
|
||||
from_iterator(It const&)
|
||||
{
|
||||
return nil_keyed_element();
|
||||
@ -49,7 +49,7 @@ namespace detail {
|
||||
*it, base::from_iterator(fusion::next(it)));
|
||||
}
|
||||
|
||||
template<typename U, typename Rst>
|
||||
template <typename U, typename Rst>
|
||||
keyed_element(keyed_element<Key, U, Rst> const& rhs)
|
||||
: Rest(rhs.get_base()), value_(rhs.value_)
|
||||
{}
|
||||
|
@ -2,7 +2,7 @@
|
||||
Copyright (c) 2005-2012 Joel de Guzman
|
||||
Copyright (c) 2005-2006 Dan Marsden
|
||||
|
||||
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_DEQUE_VALUE_AT_IMPL_08122006_0756)
|
||||
@ -13,15 +13,15 @@
|
||||
#include <boost/mpl/equal_to.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
|
||||
namespace boost { namespace fusion {
|
||||
namespace boost { namespace fusion {
|
||||
|
||||
struct deque_tag;
|
||||
|
||||
namespace extension
|
||||
namespace extension
|
||||
{
|
||||
template<typename T>
|
||||
struct value_at_impl;
|
||||
|
||||
|
||||
template<>
|
||||
struct value_at_impl<deque_tag>
|
||||
{
|
||||
@ -31,10 +31,12 @@ namespace boost { namespace fusion {
|
||||
typedef typename Sequence::next_up next_up;
|
||||
typedef typename Sequence::next_down next_down;
|
||||
BOOST_MPL_ASSERT_RELATION(next_down::value, !=, next_up::value);
|
||||
|
||||
typedef mpl::plus<next_down, mpl::int_<1> > offset;
|
||||
typedef mpl::int_<mpl::plus<N, offset>::value> adjusted_index;
|
||||
typedef typename detail::keyed_element_value_at<Sequence, adjusted_index>::type type;
|
||||
|
||||
static int const offset = next_down::value + 1;
|
||||
typedef mpl::int_<(N::value + offset)> adjusted_index;
|
||||
typedef typename
|
||||
detail::keyed_element_value_at<Sequence, adjusted_index>::type
|
||||
type;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ namespace boost { namespace fusion
|
||||
{
|
||||
template<typename Deque, typename T>
|
||||
struct front_extended_deque
|
||||
: detail::keyed_element<typename Deque::next_down, T, Deque>,
|
||||
sequence_base<front_extended_deque<Deque, T> >
|
||||
: detail::keyed_element<typename Deque::next_down, T, Deque>
|
||||
, sequence_base<front_extended_deque<Deque, T> >
|
||||
{
|
||||
typedef detail::keyed_element<typename Deque::next_down, T, Deque> base;
|
||||
typedef mpl::int_<(Deque::next_down::value - 1)> next_down;
|
||||
|
Reference in New Issue
Block a user