| 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_FRONT_09162005_0343) |
| 8 | #define FUSION_FRONT_09162005_0343 |
| 9 | |
| 10 | #include <boost/fusion/support/config.hpp> |
| 11 | #include <boost/fusion/sequence/intrinsic_fwd.hpp> |
| 12 | #include <boost/fusion/sequence/intrinsic/begin.hpp> |
| 13 | #include <boost/fusion/iterator/deref.hpp> |
| 14 | #include <boost/mpl/bool.hpp> |
| 15 | |
| 16 | namespace boost { namespace fusion |
| 17 | { |
| 18 | struct fusion_sequence_tag; |
| 19 | |
| 20 | namespace result_of |
| 21 | { |
| 22 | template <typename Sequence> |
| 23 | struct front |
| 24 | : result_of::deref<typename result_of::begin<Sequence>::type> |
| 25 | {}; |
| 26 | } |
| 27 | |
| 28 | template <typename Sequence> |
| 29 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 30 | inline typename result_of::front<Sequence>::type |
| 31 | front(Sequence& seq) |
| 32 | { |
| 33 | return *fusion::begin(seq); |
| 34 | } |
| 35 | |
| 36 | template <typename Sequence> |
| 37 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 38 | inline typename result_of::front<Sequence const>::type |
| 39 | front(Sequence const& seq) |
| 40 | { |
| 41 | return *fusion::begin(seq); |
| 42 | } |
| 43 | }} |
| 44 | |
| 45 | #endif |
| 46 |