iterable.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright Louis Dionne 2013-2017
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  4. #include <boost/hana/assert.hpp>
  5. #include <boost/hana/drop_front.hpp>
  6. #include <boost/hana/drop_while.hpp>
  7. #include <boost/hana/equal.hpp>
  8. #include <boost/hana/ext/boost/mpl/list.hpp>
  9. #include <boost/hana/ext/std/integral_constant.hpp>
  10. #include <boost/hana/front.hpp>
  11. #include <boost/hana/type.hpp>
  12. #include <boost/mpl/list.hpp>
  13. #include <type_traits>
  14. namespace hana = boost::hana;
  15. namespace mpl = boost::mpl;
  16. BOOST_HANA_CONSTANT_CHECK(hana::front(mpl::list<int, char, void>{}) == hana::type_c<int>);
  17. BOOST_HANA_CONSTANT_CHECK(hana::equal(
  18. hana::drop_front(mpl::list<int, char, void>{}),
  19. mpl::list<char, void>{}
  20. ));
  21. BOOST_HANA_CONSTANT_CHECK(hana::equal(
  22. hana::drop_while(mpl::list<float, double const, int, float&>{},
  23. hana::trait<std::is_floating_point>),
  24. mpl::list<int, float&>{}
  25. ));
  26. int main() { }