O'Reilly logo

Extended STL, Volume 1: Collections and Iterators by Matthew Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required