searchable.cpp 758 B

123456789101112131415161718192021
  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/contains.hpp>
  6. #include <boost/hana/find.hpp>
  7. #include <boost/hana/integral_constant.hpp>
  8. #include <boost/hana/optional.hpp>
  9. #include <boost/hana/string.hpp>
  10. namespace hana = boost::hana;
  11. int main() {
  12. BOOST_HANA_CONSTANT_CHECK(hana::char_c<'c'> ^hana::in^ BOOST_HANA_STRING("abcde"));
  13. BOOST_HANA_CONSTANT_CHECK(!(hana::char_c<'z'> ^hana::in^ BOOST_HANA_STRING("abcde")));
  14. BOOST_HANA_CONSTANT_CHECK(
  15. hana::find(BOOST_HANA_STRING("abcxefg"), hana::char_c<'x'>) == hana::just(hana::char_c<'x'>)
  16. );
  17. }