udl.cpp 647 B

123456789101112131415161718192021222324
  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/config.hpp>
  6. #include <boost/hana/string.hpp>
  7. #include <type_traits>
  8. namespace hana = boost::hana;
  9. int main() {
  10. // Check the _s user-defined literal
  11. #ifdef BOOST_HANA_CONFIG_ENABLE_STRING_UDL
  12. using namespace hana::literals;
  13. constexpr auto s1 = "abcd"_s;
  14. constexpr auto s2 = hana::string_c<'a', 'b', 'c', 'd'>;
  15. static_assert(std::is_same<decltype(s1), decltype(s2)>::value, "");
  16. #endif
  17. }