Ha! cool, thanks again. I'll have to delve into this some more when i
need it more. I can see how these functions can also provide very nice
ways of writing numeric vectors to file.
Things will get slightly more complicated for some other usage cases i
have, so i'll have to read up on that. I'll post back when I can
figure it out. One of them is a matrix (class written by my
colleague), i guess i could loop over the rows and then throw the
vector into the generator, or would there be more efficient
ways/tricks?
Best,
Diederick
On Mon, Aug 24, 2009 at 2:17 PM, OvermindDL1
On Sun, Aug 23, 2009 at 11:58 PM, Diederick C. Niehorster
wrote: Yup, now it works.
For reference, I got rid of the duplicated bk::eol also by using the folloing code:
bk::generate(ostream_iterator<char>(cout), "Command line options not recognized:\n" << (" \"" << ba::string << '"' << bk::eol) % "", vsTest);
Not putting an empty char array after the modulus operator would be invalid C++ and is thus required.
Why not just use what I posted? There-for you will not have a trailing eol, if you want a trailing eol then you should just loop it, not list it, do this: bk::generate(ostream_iterator<char>(cout), "Command line options not recognized:\n" << +(" \"" << ba::string << '"' << bk::eol), vsTest);
The + in front of that loop section means 1 or more, you can also use * for zero or more, but since you should be testing you array size before you call this anyway, you know you have at least one, you can also not do an array size test outside of it and do it inside the parsing function but there is not much point here it is so simple. :) _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users