3 ms·
What's the alternative to string streams for building strings pieces by pieces in C++? Plain old string concatenation? Asking for a friend... I should run bench
by uxp8u61q 3y ago
What's the alternative to string streams for building strings pieces by pieces in C++? Plain old string concatenation? Asking for a friend... I should run benchmarks I guess.
- im3w1l 3y agoAre you doing something in a hot loop or not? The answer is likely that it doesn't really matter. If you really need speed, then estimate how large string you need in advance and preallocate it (either with new char[], or string::reserve ig).