C++ 23 · Language basics
Pass a string without copying
Take a std::string_view parameter to accept strings and literals cheaply.
void log(std::string_view message) {
std::cout << message << '\n';
}
C++ 23 · Language basics
Take a std::string_view parameter to accept strings and literals cheaply.
void log(std::string_view message) {
std::cout << message << '\n';
}
Was this page helpful?