X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fstlplus%2Fstrings%2Fprint_sequence.tpp;h=8600ca834c99404cb3a4c176e877059a60a561b3;hp=cea8056e2296a9ec90c865c4aaa644d5c3e3fd4c;hb=5846afb00833cc72fe72422ca896d2387c712cb4;hpb=a97500609dc3c1b11f9786d32bc458eb00de4c36 diff --git a/src/stlplus/strings/print_sequence.tpp b/src/stlplus/strings/print_sequence.tpp index cea8056..8600ca8 100644 --- a/src/stlplus/strings/print_sequence.tpp +++ b/src/stlplus/strings/print_sequence.tpp @@ -1,50 +1,50 @@ -//////////////////////////////////////////////////////////////////////////////// - -// Author: Andy Rushton -// Copyright: (c) Southampton University 1999-2004 -// (c) Andy Rushton 2004-2009 -// License: BSD License, see ../docs/license.html - -//////////////////////////////////////////////////////////////////////////////// -#include "print_pair.hpp" - -namespace stlplus -{ - - //////////////////////////////////////////////////////////////////////////////// - // any forward iterator sequence - - template - void print_sequence(std::ostream& device, - I begin, I end, - S print_fn, - const std::string& separator) - { - for (I i = begin; i != end; i++) - { - if (i != begin) device << separator; - print_fn(device, *i); - } - } - - //////////////////////////////////////////////////////////////////////////////// - // any sequence where the value is a pair - - template - void print_pair_sequence(std::ostream& device, - I begin, I end, - S1 print_fn1, - S2 print_fn2, - const std::string& pair_separator, - const std::string& separator) - { - for (I i = begin; i != end; i++) - { - if (i != begin) device << separator; - print_pair(device, *i, print_fn1, print_fn2, pair_separator); - } - } - - //////////////////////////////////////////////////////////////////////////////// - -} // end namespace stlplus +//////////////////////////////////////////////////////////////////////////////// + +// Author: Andy Rushton +// Copyright: (c) Southampton University 1999-2004 +// (c) Andy Rushton 2004-2009 +// License: BSD License, see ../docs/license.html + +//////////////////////////////////////////////////////////////////////////////// +#include "print_pair.hpp" + +namespace stlplus +{ + + //////////////////////////////////////////////////////////////////////////////// + // any forward iterator sequence + + template + void print_sequence(std::ostream& device, + I begin, I end, + S print_fn, + const std::string& separator) + { + for (I i = begin; i != end; i++) + { + if (i != begin) device << separator; + print_fn(device, *i); + } + } + + //////////////////////////////////////////////////////////////////////////////// + // any sequence where the value is a pair + + template + void print_pair_sequence(std::ostream& device, + I begin, I end, + S1 print_fn1, + S2 print_fn2, + const std::string& pair_separator, + const std::string& separator) + { + for (I i = begin; i != end; i++) + { + if (i != begin) device << separator; + print_pair(device, *i, print_fn1, print_fn2, pair_separator); + } + } + + //////////////////////////////////////////////////////////////////////////////// + +} // end namespace stlplus