sequence.hpp 1.0 KB

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