Move string_view literal operators to str_literals namespace

This commit is contained in:
rexy712 2022-06-19 11:39:54 -07:00
parent d5a0f1927d
commit e5d8c0f567

View File

@ -133,9 +133,7 @@ namespace rexy{
extern template class basic_string_view<char32_t>; extern template class basic_string_view<char32_t>;
#endif #endif
} inline namespace str_literals{
namespace{
constexpr inline rexy::basic_string_view<char> operator"" _sv(const char* str, size_t len)noexcept{ constexpr inline rexy::basic_string_view<char> operator"" _sv(const char* str, size_t len)noexcept{
return rexy::basic_string_view(str, len); return rexy::basic_string_view(str, len);
@ -149,11 +147,16 @@ namespace{
constexpr inline rexy::basic_string_view<char32_t> operator"" _sv(const char32_t* str, size_t len)noexcept{ constexpr inline rexy::basic_string_view<char32_t> operator"" _sv(const char32_t* str, size_t len)noexcept{
return rexy::basic_string_view(str, len); return rexy::basic_string_view(str, len);
} }
}
}
namespace{
template<class Char> template<class Char>
std::ostream& operator<<(std::ostream& os, const rexy::basic_string_view<Char>& str){ std::ostream& operator<<(std::ostream& os, const rexy::basic_string_view<Char>& str){
return os << str.c_str(); return os << str.c_str();
} }
} }
#include "string_view.tpp" #include "string_view.tpp"