cxxomfort
rel.20210622
Simple backports for C++ - http://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
Backports related to Standard header <string_view>
Interfaces defined here:
basic_string_view
- view to a string-like object (C++17).string_view
.CXXOMFORT_IMPLEMENTS_stdheader_string_view
- implementation status for the above.""sv
to C++11 upto C++14.For differences between the implementation of string_view
here vs standard, check the notices at basic_string_view
Fix (non-backport) interfaces:
sv()
- Makes a string_view
from a std::string or a literal string.C++17 onwards defines operator"" sv
as the user-defined literal to create basic_string_view
objects. The cxxomfort library backports the string_view
and wstring_view
capable versions of this user-defined literal.
""sv
is reserved. While this means the library can add the backport correctly, it could be that the compiler is blocking its use. It is compiler-dependent whether it is possible to disable this warning or error (see eg.: https://stackoverflow.com/questions/31509434/gcc-does-not-honor-pragma-gcc-diagnostic-to-silence-warnings ).-isystem
.cxxomfort::fix::sv()
instead (see the next section).The helper function sv() creates a basic_string_view
. It is provided to serve as a supplement to the "user-defined literal" ""sv
where it is not available: