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 34. An Enhanced ostream_iterator

 

I have benefited greatly from criticism, and at no time have I suffered a lack thereof.

 
 --Winston Churchill
 

I’m so gorgeous, there’s a six-month waiting list for birds to suddenly appear, every time I am near!

 
 --Cat, Red Dwarf

Introduction

Do you ever find yourself wanting to output the contents of a sequence where the elements are to be indented, perhaps by a tab space ('\t'), as in the following example?

Header Files:
    H:\freelibs\b64\current\include\b64\b64.h
    H:\freelibs\b64\current\include\b64\cpp\b64.hpp
Implementation Files:
    H:\freelibs\b64\current\src\b64.c
    H:\freelibs\b64\current\test\C\C.c
    H:\freelibs\b64\current\test\Cpp\Cpp.cpp

Using std::ostream_iterator, this is disproportionately difficult and ...

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