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';
}

Official C++ 23 documentation

More language basics commands

All language basics commands · C++ 23 cheatsheet

Was this page helpful?