string_view.hpp 817 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // Copyright (c) 2022 Alan de Freitas ([email protected])
  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/url
  8. //
  9. #ifndef BOOST_URL_DETAIL_STRING_VIEW_HPP
  10. #define BOOST_URL_DETAIL_STRING_VIEW_HPP
  11. #include <boost/core/detail/string_view.hpp>
  12. namespace boost {
  13. namespace urls {
  14. namespace detail {
  15. // We use detail::to_sv(s) instead of core::string_view(s) whenever
  16. // we should convert to core::string_view.
  17. // This is a workaround for GCC >=8.0 <8.4
  18. // See: https://github.com/boostorg/url/issues/672
  19. template<class T>
  20. core::string_view
  21. to_sv(T const& t) noexcept
  22. {
  23. return core::string_view(t);
  24. }
  25. } // detail
  26. } // urls
  27. } // boost
  28. #endif