// Copyright Louis Dionne 2013-2017 // Copyright Jason Rice 2017 // 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 TEST_SUPPORT_COUNTER_HPP #define TEST_SUPPORT_COUNTER_HPP #include #include #include #include #include // Counter - an infinite iterable for the masses struct Counter_tag { }; template struct Counter { using hana_tag = Counter_tag; static constexpr std::size_t value = N; }; namespace boost { namespace hana { ////////////////////////////////////////////////////////////////////////// // Iterable ////////////////////////////////////////////////////////////////////////// template <> struct at_impl { template static constexpr decltype(auto) apply(T, N) { return hana::size_c; } }; template <> struct drop_front_impl { template static constexpr auto apply(T, N) { return Counter{}; } }; template <> struct is_empty_impl { template static constexpr auto apply(Xs) -> hana::false_ { return {}; } }; }} // end namespace boost::hana #endif // !TEST_SUPPORT_COUNTER_HPP