any_of.cpp 835 B

1234567891011121314151617181920212223242526272829
  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/any_of.hpp>
  5. #include <boost/hana/assert.hpp>
  6. #include <boost/hana/equal.hpp>
  7. #include <boost/hana/integral_constant.hpp>
  8. #include <boost/hana/not.hpp>
  9. #include <boost/hana/string.hpp>
  10. namespace hana = boost::hana;
  11. int main() {
  12. BOOST_HANA_CONSTANT_CHECK(hana::any_of(
  13. BOOST_HANA_STRING("abcd"),
  14. hana::equal.to(hana::char_c<'b'>)
  15. ));
  16. BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::any_of(
  17. BOOST_HANA_STRING(""),
  18. hana::always(hana::true_c)
  19. )));
  20. BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::any_of(
  21. BOOST_HANA_STRING("abcd"),
  22. hana::equal.to(hana::char_c<'z'>)
  23. )));
  24. }