class basic_cstring_view
Declaration
template <typename Char>
class basic_cstring_view { /* full declaration omitted */ };
Description
\rstA reference to a null-terminated string. It can be constructed from a C string or ``std::string``. You can use one of the following type aliases for common character types: +---------------+-----------------------------+ | Type | Definition | +===============+=============================+ | cstring_view | basic_cstring_view <char > | +---------------+-----------------------------+ | wcstring_view | basic_cstring_view <wchar _t> | +---------------+-----------------------------+ This class is most useful as a parameter type to allow passing different types of strings to a function, for example:: template <typename ... Args> std::string format(cstring_view format_str, const Args & ... args); format("{}", 42); format(std::string("{}"), 42);\endrst
Declared at: third_party/fmt/include/fmt/os.h:101
Templates
- Char
Method Overview
- public basic_cstring_view<Char>(const Char * s)
- public basic_cstring_view<Char>(const std::basic_string<Char> & s)
- public const Char * c_str() const
Methods
¶basic_cstring_view<Char>(const Char* s)
basic_cstring_view<Char>(const Char* s)
Description
Constructs a string reference object from a C string.
Declared at: third_party/fmt/include/fmt/os.h:107
Parameters
- const Char* s
¶basic_cstring_view<Char>(
const std::basic_string<Char>& s)
basic_cstring_view<Char>(
const std::basic_string<Char>& s)
Description
\rstConstructs a string reference from an ``std::string`` object.\endrst
Declared at: third_party/fmt/include/fmt/os.h:114
Parameters
- const std::basic_string<Char>& s
¶const Char* c_str() const
const Char* c_str() const
Description
Returns the pointer to a C string.
Declared at: third_party/fmt/include/fmt/os.h:117