Chapter 39. C-Style String Concatenation
I may not agree with what you say but I shall defend your right to say it to the death. | ||
--Voltaire |
I too was concocting this very same plan; already our minds are becoming one! | ||
--Puss-in-boots,Shrek 2 |
Motivation
In the previous chapter we looked at how the Pantheios library core used member_selector_iterator
for calculating the total logging entry string length from the array of string slices (pan_slice_t const*
), via the standard library algorithm accumulate()
. In this chapter we’re going to look at the other major part of the logging operation: concatenation of the string slices into the allocated buffer, using the standard library algorithm copy()
. Let’s dive straight in and look at the function implementation ...
Get Extended STL, Volume 1: Collections and Iterators now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.