summaryrefslogtreecommitdiff
path: root/boost/hana/concept/sequence.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/hana/concept/sequence.hpp')
-rw-r--r--boost/hana/concept/sequence.hpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/boost/hana/concept/sequence.hpp b/boost/hana/concept/sequence.hpp
new file mode 100644
index 0000000000..b2c6cda50c
--- /dev/null
+++ b/boost/hana/concept/sequence.hpp
@@ -0,0 +1,41 @@
+/*!
+@file
+Defines `boost::hana::Sequence`.
+
+@copyright Louis Dionne 2013-2016
+Distributed under the Boost Software License, Version 1.0.
+(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
+ */
+
+#ifndef BOOST_HANA_CONCEPT_SEQUENCE_HPP
+#define BOOST_HANA_CONCEPT_SEQUENCE_HPP
+
+#include <boost/hana/fwd/concept/sequence.hpp>
+
+#include <boost/hana/config.hpp>
+#include <boost/hana/core/tag_of.hpp>
+#include <boost/hana/core/when.hpp>
+
+
+BOOST_HANA_NAMESPACE_BEGIN
+ namespace detail {
+ template <typename S, typename Tag = typename hana::tag_of<S>::type>
+ struct sequence_dispatch {
+ static constexpr bool value = hana::Sequence<Tag>::value;
+ };
+
+ template <typename S>
+ struct sequence_dispatch<S, S> {
+ static constexpr bool value = false;
+ };
+ }
+
+ //! @cond
+ template <typename S, bool condition>
+ struct Sequence<S, when<condition>>
+ : detail::sequence_dispatch<S>
+ { };
+ //! @endcond
+BOOST_HANA_NAMESPACE_END
+
+#endif // !BOOST_HANA_CONCEPT_SEQUENCE_HPP