Boost logo

Boost :

From: Emre Turkay (emreturkay.tr_at_[hidden])
Date: 2007-01-12 08:22:23

Hi folks,

Attached is the csv_ostream_iterator class, I frequently use. I think it
could be incorporated into the boost.iterator library (if there is no such
thing somewhere in the standart or in some boost library so far.)

What it does is very similar to the std::ostream_iterator, the only
difference is that it does not put a delimiter after the last element
inserted. Such as when we write an integer container to a stream with a
comma delimiter, we get something like this: { 1, 7, 12, 5, 8, } however by
using this class the last delimiter is gone { 1, 7, 12, 5, 8 } which is
mostly the intended behavior.

It can be used for textual data generation (for correct CSVs and good
looking XMLs) including code generation.

Note: Works with gcc-4.x, may needs to be modified to be portable.


Emre Turkay

Boost list run by bdawes at, gregod at, cpdaniel at, john at