2016-03-29 09:02:51 +00:00
|
|
|
/*=============================================================================
|
2017-07-29 05:20:01 +00:00
|
|
|
Copyright (c) 2011-2017 Bolero MURAKAMI
|
2016-03-29 09:02:51 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
=============================================================================*/
|
2016-08-14 07:02:23 +00:00
|
|
|
#ifndef SPROUT_UTILITY_STRING_VIEW_LITERALS_HPP
|
|
|
|
#define SPROUT_UTILITY_STRING_VIEW_LITERALS_HPP
|
2016-03-29 09:02:51 +00:00
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/utility/string_view/string_view.hpp>
|
2016-08-14 07:02:23 +00:00
|
|
|
#include <sprout/detail/udl_namespace.hpp>
|
2016-03-29 09:02:51 +00:00
|
|
|
|
|
|
|
#if SPROUT_USE_USER_DEFINED_LITERALS
|
|
|
|
|
|
|
|
#include <sprout/workaround/std/cstddef.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
2016-08-14 07:02:23 +00:00
|
|
|
namespace literals {
|
2016-04-16 00:50:04 +00:00
|
|
|
namespace strings {
|
|
|
|
//
|
|
|
|
// _sv
|
|
|
|
//
|
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string_view<char>
|
|
|
|
operator"" _sv(char const* s, std::size_t size) {
|
|
|
|
return sprout::basic_string_view<char>(s, size);
|
|
|
|
}
|
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string_view<wchar_t>
|
|
|
|
operator"" _sv(wchar_t const* s, std::size_t size) {
|
|
|
|
return sprout::basic_string_view<wchar_t>(s, size);
|
|
|
|
}
|
2016-03-29 09:02:51 +00:00
|
|
|
#if SPROUT_USE_UNICODE_LITERALS
|
2016-04-16 00:50:04 +00:00
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string_view<char16_t>
|
|
|
|
operator"" _sv(char16_t const* s, std::size_t size) {
|
|
|
|
return sprout::basic_string_view<char16_t>(s, size);
|
|
|
|
}
|
|
|
|
inline SPROUT_CONSTEXPR sprout::basic_string_view<char32_t>
|
|
|
|
operator"" _sv(char32_t const* s, std::size_t size) {
|
|
|
|
return sprout::basic_string_view<char32_t>(s, size);
|
|
|
|
}
|
2016-03-29 09:02:51 +00:00
|
|
|
#endif
|
2016-04-16 00:50:04 +00:00
|
|
|
} // namespace strings
|
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
using sprout::literals::strings::operator"" _sv;
|
|
|
|
} // namespace literals
|
2016-03-29 09:02:51 +00:00
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
using sprout::literals::strings::operator"" _sv;
|
2016-03-29 09:02:51 +00:00
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #if SPROUT_USE_USER_DEFINED_LITERALS
|
|
|
|
|
2016-08-14 07:02:23 +00:00
|
|
|
#endif // #ifndef SPROUT_UTILITY_STRING_VIEW_LITERALS_HPP
|