On (01 Apr 97) Jean-Pol Landrain wrote to Jerry Coffin...
JL> Salut Jerry,
Hello,
JC> [ wanting to write a manipulator with two parameters ]
[ example code elided ]
JL> Great !!! That's exactly what I was looking for.
JL> Now, how can I do that with templates ?
Basically you just eliminate any `IOMANIPdeclare's, and change
`OMANIP(TYPE)' to `omanip' (likewise with IMANIP, IOMANIP, etc.)
For example, in the code I posted previously, delete the IOMANIPdeclare
line, and replace `fill_lines' with the following:
omanip fill_lines(char ch, int lines = 1, int width = 79)
{
line_filler p(ch, width, lines);
return omanip (line_filler::do_fill, p);
}
And it should work with, say, the latest version of BC++. (It did for me
anyway...)
Later,
Jerry.
... The Universe is a figment of its own imagination.
--- PPoint 1.90
---------------
* Origin: Point Pointedly Pointless (1:128/166.5)
|