Skip to content

Commit 4ce982c

Browse files
committed
Headers: Add string_view literals
1 parent 40c328a commit 4ce982c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

headers/string_view

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,23 @@ constexpr bool
188188
operator>=(basic_string_view<CharT, Traits> lhs,
189189
basic_string_view<CharT, Traits> rhs) noexcept;
190190

191+
inline namespace literals {
192+
inline namespace string_view_literals {
193+
194+
constexpr string_view operator "" sv(const char* str, size_t len) noexcept;
195+
196+
#if CPPREFERENCE_STDVER >= 2020
197+
constexpr u8string_view
198+
operator "" sv(const char8_t* str, size_t len) noexcept;
199+
#endif
200+
201+
constexpr u16string_view operator "" sv(const char16_t* str, size_t len) noexcept;
202+
constexpr u32string_view operator "" sv(const char32_t* str, size_t len) noexcept;
203+
constexpr wstring_view operator "" sv(const wchar_t* str, size_t len) noexcept;
204+
205+
} // namespace string_view_literals
206+
} // namespace literals
207+
191208
} // namespace std
192209

193210
#endif // CPPREFERENCE_STDVER >= 2017

0 commit comments

Comments
 (0)