include/boost/url/detail/string_view.hpp
100.0% Lines (8/8)
100.0% List of functions (3/4)
Functions (4)
Function
Calls
Lines
Blocks
<unknown function 26>
:26
–
–
–
boost::core::basic_string_view<char> boost::urls::detail::to_sv<boost::core::basic_string_view<char> >(boost::core::basic_string_view<char> const&)
:26
16x
100.0%
100.0%
boost::core::basic_string_view<char> boost::urls::detail::to_sv<char [18]>(char const (&) [18])
:26
2x
100.0%
100.0%
boost::core::basic_string_view<char> boost::urls::detail::to_sv<char [2]>(char const (&) [2])
:26
2x
100.0%
100.0%
| Line | TLA | Hits | Source Code |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.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/url | ||
| 8 | // | ||
| 9 | |||
| 10 | #ifndef BOOST_URL_DETAIL_STRING_VIEW_HPP | ||
| 11 | #define BOOST_URL_DETAIL_STRING_VIEW_HPP | ||
| 12 | |||
| 13 | #include <boost/core/detail/string_view.hpp> | ||
| 14 | |||
| 15 | namespace boost { | ||
| 16 | namespace urls { | ||
| 17 | namespace detail { | ||
| 18 | |||
| 19 | // We use detail::to_sv(s) instead of core::string_view(s) whenever | ||
| 20 | // we should convert to core::string_view. | ||
| 21 | // This is a workaround for GCC >=8.0 <8.4 | ||
| 22 | // See: https://github.com/boostorg/url/issues/672 | ||
| 23 | template<class T> | ||
| 24 | BOOST_CXX14_CONSTEXPR | ||
| 25 | core::string_view | ||
| 26 | 11515x | to_sv(T const& t) noexcept | |
| 27 | { | ||
| 28 | 11515x | return core::string_view(t); | |
| 29 | } | ||
| 30 | |||
| 31 | } // detail | ||
| 32 | } // urls | ||
| 33 | } // boost | ||
| 34 | |||
| 35 | #endif | ||
| 36 |