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 10 #ifndef BOOST_BEAST_STRING_TYPE_HPP 11 #define BOOST_BEAST_STRING_TYPE_HPP 12 13 #include <boost/beast/core/detail/config.hpp> 14 15 #if defined(BOOST_BEAST_USE_STD_STRING_VIEW) 16 #include <string_view> 17 #else 18 #include <boost/utility/string_view.hpp> 19 #endif 20 21 namespace boost { 22 namespace beast { 23 24 #if BOOST_BEAST_DOXYGEN || ! defined(BOOST_BEAST_USE_STD_STRING_VIEW) 25 /// The type of string view used by the library 26 using string_view = boost::string_view; 27 28 /// The type of `basic_string_view` used by the library 29 template<class CharT, class Traits> 30 using basic_string_view = 31 boost::basic_string_view<CharT, Traits>; 32 33 #else 34 using string_view = std::string_view; 35 36 template<class CharT, class Traits> 37 using basic_string_view = 38 std::basic_string_view<CharT, Traits>; 39 40 #endif 41 42 } // beast 43 } // boost 44 45 #endif 46