/*============================================================================= 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_FUSION_DEQUE_26112006_1649) #define BOOST_FUSION_DEQUE_26112006_1649 # include /////////////////////////////////////////////////////////////////////////////// // Without variadics, we will use the PP version /////////////////////////////////////////////////////////////////////////////// #if !defined(BOOST_FUSION_HAS_VARIADIC_DEQUE) # include #else /////////////////////////////////////////////////////////////////////////////// // C++11 interface /////////////////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace fusion { struct deque_tag; 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 BOOST_FUSION_GPU_ENABLED deque(Sequence const&, typename enable_if< mpl::and_< traits::is_sequence , result_of::empty>>::type* /*dummy*/ = 0) {} BOOST_FUSION_GPU_ENABLED deque() {} }; template struct deque : detail::deque_keyed_values::type , sequence_base> { typedef deque_tag fusion_tag; typedef bidirectional_traversal_tag category; typedef typename detail::deque_keyed_values::type base; typedef mpl::int_<(sizeof ...(Tail) + 1)> size; typedef mpl::int_ next_up; typedef mpl::int_<((size::value == 0) ? 0 : -1)> next_down; typedef mpl::false_ is_view; BOOST_FUSION_GPU_ENABLED deque() {} template BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} template BOOST_FUSION_GPU_ENABLED deque(deque& seq) : base(seq) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward>(seq)) {} #endif BOOST_FUSION_GPU_ENABLED deque(deque const& seq) : base(seq) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) BOOST_FUSION_GPU_ENABLED deque(deque&& seq) : base(std::forward(seq)) {} #endif BOOST_FUSION_GPU_ENABLED explicit deque(Head const& head, Tail const&... tail) : base(detail::deque_keyed_values::construct(head, tail...)) {} template BOOST_FUSION_GPU_ENABLED explicit deque(Head_ const& head, Tail_ const&... tail) : base(detail::deque_keyed_values::construct(head, tail...)) {} #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED explicit deque(Head_&& head, Tail_&&... tail) : base(detail::deque_keyed_values ::forward_(std::forward(head), std::forward(tail)...)) {} #endif template BOOST_FUSION_GPU_ENABLED explicit deque(Sequence const& seq , typename disable_if >::type* /*dummy*/ = 0) : base(base::from_iterator(fusion::begin(seq))) {} template BOOST_FUSION_GPU_ENABLED deque& operator=(deque const& rhs) { base::operator=(rhs); return *this; } template BOOST_FUSION_GPU_ENABLED deque& operator=(T const& rhs) { base::operator=(rhs); return *this; } #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED deque& operator=(T&& rhs) { base::operator=(std::forward(rhs)); return *this; } #endif }; }} #endif #endif