Move string_view literal operators to str_literals namespace
This commit is contained in:
parent
d5a0f1927d
commit
e5d8c0f567
@ -133,27 +133,30 @@ namespace rexy{
|
|||||||
extern template class basic_string_view<char32_t>;
|
extern template class basic_string_view<char32_t>;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline namespace str_literals{
|
||||||
|
|
||||||
|
constexpr inline rexy::basic_string_view<char> operator"" _sv(const char* str, size_t len)noexcept{
|
||||||
|
return rexy::basic_string_view(str, len);
|
||||||
|
}
|
||||||
|
constexpr inline rexy::basic_string_view<wchar_t> operator"" _sv(const wchar_t* str, size_t len)noexcept{
|
||||||
|
return rexy::basic_string_view(str, len);
|
||||||
|
}
|
||||||
|
constexpr inline rexy::basic_string_view<char16_t> operator"" _sv(const char16_t* str, size_t len)noexcept{
|
||||||
|
return rexy::basic_string_view(str, len);
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace{
|
namespace{
|
||||||
|
|
||||||
constexpr inline rexy::basic_string_view<char> operator"" _sv(const char* str, size_t len)noexcept{
|
|
||||||
return rexy::basic_string_view(str, len);
|
|
||||||
}
|
|
||||||
constexpr inline rexy::basic_string_view<wchar_t> operator"" _sv(const wchar_t* str, size_t len)noexcept{
|
|
||||||
return rexy::basic_string_view(str, len);
|
|
||||||
}
|
|
||||||
constexpr inline rexy::basic_string_view<char16_t> operator"" _sv(const char16_t* str, size_t len)noexcept{
|
|
||||||
return rexy::basic_string_view(str, len);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
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"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user