Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:42

0001 //
0002 // Copyright (c) 2019-2023 Ruben Perez Hidalgo (rubenperez038 at gmail dot 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 
0008 #ifndef BOOST_MYSQL_IMPL_INTERNAL_MAKE_STRING_VIEW_HPP
0009 #define BOOST_MYSQL_IMPL_INTERNAL_MAKE_STRING_VIEW_HPP
0010 
0011 #include <boost/mysql/string_view.hpp>
0012 
0013 namespace boost {
0014 namespace mysql {
0015 namespace detail {
0016 
0017 template <std::size_t N>
0018 constexpr string_view make_string_view(const char (&buff)[N]) noexcept
0019 {
0020     static_assert(N >= 1, "Expected a C-array literal");
0021     return string_view(buff, N - 1);  // discard null terminator
0022 }
0023 
0024 }  // namespace detail
0025 }  // namespace mysql
0026 }  // namespace boost
0027 
0028 #endif