]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*! |
2 | @file | |
3 | Defines `boost::hana::Sequence`. | |
4 | ||
5 | @copyright Louis Dionne 2013-2016 | |
6 | Distributed under the Boost Software License, Version 1.0. | |
7 | (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | |
8 | */ | |
9 | ||
10 | #ifndef BOOST_HANA_CONCEPT_SEQUENCE_HPP | |
11 | #define BOOST_HANA_CONCEPT_SEQUENCE_HPP | |
12 | ||
13 | #include <boost/hana/fwd/concept/sequence.hpp> | |
14 | ||
15 | #include <boost/hana/config.hpp> | |
16 | #include <boost/hana/core/tag_of.hpp> | |
17 | #include <boost/hana/core/when.hpp> | |
18 | ||
19 | ||
20 | BOOST_HANA_NAMESPACE_BEGIN | |
21 | namespace detail { | |
22 | template <typename S, typename Tag = typename hana::tag_of<S>::type> | |
23 | struct sequence_dispatch { | |
24 | static constexpr bool value = hana::Sequence<Tag>::value; | |
25 | }; | |
26 | ||
27 | template <typename S> | |
28 | struct sequence_dispatch<S, S> { | |
29 | static constexpr bool value = false; | |
30 | }; | |
31 | } | |
32 | ||
33 | //! @cond | |
34 | template <typename S, bool condition> | |
35 | struct Sequence<S, when<condition>> | |
36 | : detail::sequence_dispatch<S> | |
37 | { }; | |
38 | //! @endcond | |
39 | BOOST_HANA_NAMESPACE_END | |
40 | ||
41 | #endif // !BOOST_HANA_CONCEPT_SEQUENCE_HPP |