| 1 |
|
|
1 |
|
|
| 2 |
|
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
|
2 |
|
// Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.com)
|
| 3 |
|
|
3 |
|
|
| 4 |
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
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)
|
5 |
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
| 6 |
|
|
6 |
|
|
| 7 |
|
// Official repository: https://github.com/boostorg/url
|
7 |
|
// Official repository: https://github.com/boostorg/url
|
| 8 |
|
|
8 |
|
|
| 9 |
|
|
9 |
|
|
| 10 |
|
#ifndef BOOST_URL_DETAIL_STRING_VIEW_HPP
|
10 |
|
#ifndef BOOST_URL_DETAIL_STRING_VIEW_HPP
|
| 11 |
|
#define BOOST_URL_DETAIL_STRING_VIEW_HPP
|
11 |
|
#define BOOST_URL_DETAIL_STRING_VIEW_HPP
|
| 12 |
|
|
12 |
|
|
| 13 |
|
#include <boost/core/detail/string_view.hpp>
|
13 |
|
#include <boost/core/detail/string_view.hpp>
|
| 14 |
|
|
14 |
|
|
| 15 |
|
|
15 |
|
|
| 16 |
|
|
16 |
|
|
| 17 |
|
|
17 |
|
|
| 18 |
|
|
18 |
|
|
| 19 |
|
// We use detail::to_sv(s) instead of core::string_view(s) whenever
|
19 |
|
// We use detail::to_sv(s) instead of core::string_view(s) whenever
|
| 20 |
|
// we should convert to core::string_view.
|
20 |
|
// we should convert to core::string_view.
|
| 21 |
|
// This is a workaround for GCC >=8.0 <8.4
|
21 |
|
// This is a workaround for GCC >=8.0 <8.4
|
| 22 |
|
// See: https://github.com/boostorg/url/issues/672
|
22 |
|
// See: https://github.com/boostorg/url/issues/672
|
| 23 |
|
|
23 |
|
|
| 24 |
|
|
24 |
|
|
| 25 |
|
|
25 |
|
|
| 26 |
|
to_sv(T const& t) noexcept
|
26 |
|
to_sv(T const& t) noexcept
|
| 27 |
|
|
27 |
|
|
| 28 |
|
return core::string_view(t);
|
28 |
|
return core::string_view(t);
|
| 29 |
|
|
29 |
|
|
| 30 |
|
|
30 |
|
|
| 31 |
|
|
31 |
|
|
| 32 |
|
|
32 |
|
|
| 33 |
|
|
33 |
|
|
| 34 |
|
|
34 |
|
|
| 35 |
|
|
35 |
|
|