Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC++string and string_viewSingle-choice MCQ

Why might passing a string literal to a `std::string_view` parameter be cheaper than to a `const std::string&` parameter?

void useView(std::string_view sv); void useRef(const std::string& s); useView("hello"); useRef("hello");