| 1 | /*============================================================================= |
|---|---|
| 2 | Copyright (c) 2001-2011 Joel de Guzman |
| 3 | Copyright (c) 2007 Tobias Schwinger |
| 4 | |
| 5 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 7 | ==============================================================================*/ |
| 8 | #if !defined(FUSION_SEQUENCE_BASE_04182005_0737) |
| 9 | #define FUSION_SEQUENCE_BASE_04182005_0737 |
| 10 | |
| 11 | #include <boost/config.hpp> |
| 12 | #include <boost/fusion/support/config.hpp> |
| 13 | #include <boost/mpl/begin_end_fwd.hpp> |
| 14 | |
| 15 | namespace boost { namespace fusion |
| 16 | { |
| 17 | namespace detail |
| 18 | { |
| 19 | struct from_sequence_convertible_type |
| 20 | {}; |
| 21 | } |
| 22 | |
| 23 | template <typename Sequence> |
| 24 | struct sequence_base |
| 25 | { |
| 26 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 27 | Sequence const& |
| 28 | derived() const BOOST_NOEXCEPT |
| 29 | { |
| 30 | return static_cast<Sequence const&>(*this); |
| 31 | } |
| 32 | |
| 33 | BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 34 | Sequence& |
| 35 | derived() BOOST_NOEXCEPT |
| 36 | { |
| 37 | return static_cast<Sequence&>(*this); |
| 38 | } |
| 39 | |
| 40 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 41 | operator detail::from_sequence_convertible_type() const BOOST_NOEXCEPT |
| 42 | { |
| 43 | return detail::from_sequence_convertible_type(); |
| 44 | } |
| 45 | }; |
| 46 | |
| 47 | struct fusion_sequence_tag; |
| 48 | }} |
| 49 | |
| 50 | namespace boost { namespace mpl |
| 51 | { |
| 52 | // Deliberately break mpl::begin, so it doesn't lie that a Fusion sequence |
| 53 | // is not an MPL sequence by returning mpl::void_. |
| 54 | // In other words: Fusion Sequences are always MPL Sequences, but they can |
| 55 | // be incompletely defined. |
| 56 | template<> struct begin_impl< boost::fusion::fusion_sequence_tag >; |
| 57 | }} |
| 58 | |
| 59 | #endif |
| 60 |
