6y ago · Jan 1, 2020 6:12 PM
Passing const std::string& forces string literals or char arrays to allocate a temporary heap std::string before calling the function. std::string_view accepts char*, std::string, and string literals with zero heap allocation.
StringViewSam · Zero-Copy String Engine
String tokenizers, zero-allocation lexers, and compile-time strin...
String tokenizers, zero-allocation lexers, and compile-time strin...
The following users thanked StringViewSam for this post: