string_type.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/beast
  8. //
  9. #ifndef BOOST_BEAST_STRING_TYPE_HPP
  10. #define BOOST_BEAST_STRING_TYPE_HPP
  11. #include <boost/beast/core/detail/config.hpp>
  12. #if defined(BOOST_BEAST_USE_STD_STRING_VIEW)
  13. #include <string_view>
  14. #else
  15. #include <boost/utility/string_view.hpp>
  16. #endif
  17. namespace boost {
  18. namespace beast {
  19. #if BOOST_BEAST_DOXYGEN || ! defined(BOOST_BEAST_USE_STD_STRING_VIEW)
  20. /// The type of string view used by the library
  21. using string_view = boost::string_view;
  22. /// The type of `basic_string_view` used by the library
  23. template<class CharT, class Traits>
  24. using basic_string_view =
  25. boost::basic_string_view<CharT, Traits>;
  26. #else
  27. using string_view = std::string_view;
  28. template<class CharT, class Traits>
  29. using basic_string_view =
  30. std::basic_string_view<CharT, Traits>;
  31. #endif
  32. } // beast
  33. } // boost
  34. #endif