| 1 | /*============================================================================= |
|---|---|
| 2 | Copyright (c) 2001-2011 Joel de Guzman |
| 3 | |
| 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | ==============================================================================*/ |
| 7 | #if !defined(FUSION_POP_FRONT_09172005_1115) |
| 8 | #define FUSION_POP_FRONT_09172005_1115 |
| 9 | |
| 10 | #include <boost/fusion/support/config.hpp> |
| 11 | #include <boost/fusion/view/iterator_range/iterator_range.hpp> |
| 12 | #include <boost/fusion/sequence/intrinsic/begin.hpp> |
| 13 | #include <boost/fusion/sequence/intrinsic/end.hpp> |
| 14 | #include <boost/fusion/iterator/next.hpp> |
| 15 | |
| 16 | namespace boost { namespace fusion |
| 17 | { |
| 18 | namespace result_of |
| 19 | { |
| 20 | template <typename Sequence> |
| 21 | struct pop_front |
| 22 | { |
| 23 | typedef |
| 24 | iterator_range< |
| 25 | typename next< |
| 26 | typename begin<Sequence>::type |
| 27 | >::type |
| 28 | , typename end<Sequence>::type |
| 29 | > |
| 30 | type; |
| 31 | }; |
| 32 | } |
| 33 | |
| 34 | template <typename Sequence> |
| 35 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 36 | inline typename result_of::pop_front<Sequence const>::type |
| 37 | pop_front(Sequence const& seq) |
| 38 | { |
| 39 | typedef typename result_of::pop_front<Sequence const>::type result; |
| 40 | return result(fusion::next(fusion::begin(seq)), fusion::end(seq)); |
| 41 | } |
| 42 | }} |
| 43 | |
| 44 | #endif |
| 45 | |
| 46 |
