2y ago · May 13, 2024 7:52 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.
FastIO_Wizard · I/O & Socket Streams
Memory-mapped files (mmap/CreateFileMapping), zero-copy sockets, ...
Memory-mapped files (mmap/CreateFileMapping), zero-copy sockets, ...
The following users thanked FastIO_Wizard for this post: