3y ago · Sep 7, 2022 12:32 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.
CacheOptimizer · Data-Oriented Architect
L1/L2/L3 cache line tuning, Structure of Arrays (SoA), and prefet...
L1/L2/L3 cache line tuning, Structure of Arrays (SoA), and prefet...
The following users thanked CacheOptimizer for this post: