Re: How to encode text into html format
On Jun 1, 11:25 pm, Frank Birbacher <bloodymir.c...@gmx.net> wrote:
James Kanze schrieb:
As to the third: how? You're replacing a single character with
a sequence of characters, and transform does a one to one (which
in practice makes it of fairly limited utility---although I've
used it with a vector<string>, ostream_iterator, and as string
transformer class that I've written, which works something like
$(patsubst...) in GNU make).
The source range of transform may have another value type than the
destination range.
I'm aware of that, however...
char const* replace(char);
transform(str.begin(), str.end(),
ostream_iterator<const char*>(cout),
&replace);
For some reason, I was thinking in terms of std::string, and not
char const*. And converting each std::string seemed a bit heavy
for the task at hand. But a statically generated char const*[];
why not?
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34