Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:54:14

0001 //
0002 // Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/json
0008 //
0009 
0010 #ifndef BOOST_JSON_STRING_VIEW_HPP
0011 #define BOOST_JSON_STRING_VIEW_HPP
0012 
0013 #include <boost/json/detail/config.hpp>
0014 #include <boost/core/detail/string_view.hpp>
0015 #include <type_traits>
0016 #ifndef BOOST_NO_CXX17_HDR_STRING_VIEW
0017 # include <string_view>
0018 #endif
0019 
0020 namespace boost {
0021 namespace json {
0022 
0023 #ifdef BOOST_JSON_DOCS
0024 
0025 /** The type of string view used by the library.
0026 
0027     The type has API equivalent to that of `std::string_view` and is
0028     convertible to/from it.
0029 */
0030 using string_view = __see_below__;
0031 
0032 #else
0033 
0034 using string_view = boost::core::string_view;
0035 
0036 #endif
0037 
0038 namespace detail {
0039 
0040 template<class T>
0041 using is_string_viewish = typename std::enable_if<
0042     std::is_convertible<
0043         T const&, string_view>::value &&
0044     ! std::is_convertible<
0045         T const&, char const*>::value
0046             >::type;
0047 
0048 } // detail
0049 
0050 } // namespace json
0051 } // namespace boost
0052 
0053 #endif