bsl::operator""_sv

Convert a character sequence of the specified length excluding the terminating null character starting at the beginning of the specified characterString to a string_view object of the indicated return type. (See the "User-Defined Literals" section in the component-level documentation.)

Synopsis

Declared in <bslstl_stringview.h>

std::string_view
operator""_sv(
    char const* characterString,
    std::size_t length);

Description

Example: ` using namespace bsl::string_view_literals; bsl::string_view sv1 = "1230abc"; bsl::string_view sv2 = "1230abc"_sv; assert(3 == sv1.size()); assert(7 == sv2.size());

bsl::wstring_view sv3 = L"1230abc"_sv; assert(7 == sv3.size()); `