On Sun, Aug 23, 2009 at 10:03 PM, Diederick C.
Niehorster
Hi Harmut,
Thank you for the answers. However, I am still having some trouble and i figure it out following the documentation on the list operator.
I am trying to produce an output like below: Options not recognized: "dd" "-e" "rrty"
However, bk::generate(ostream_iterator<char>(cout), "Command line options not recognized:\n" << (" \"" << ba::string % "\"" << bk::eol) << bk::eol, vsUnrecog);
does not do the trick and
bk::generate(ostream_iterator<char>(cout), "Command line options not recognized:\n" << (" \"" % ba::string % "\"" << bk::eol) << bk::eol, vsUnrecog);
fails with "..\Dependency\boost\boost/spirit/home/karma/string/lit.hpp(108) : error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1 from 'boost::mpl::failed ************(__thiscall boost::spirit::karma::any_string
::generate::string_not_usable_without_attribute::* ***********)(void)' to 'boost::mpl::assert<false>::type'" (which I guess is not the way it should fail? Shouldnt there be a nice assertion message or is this it? no experience with it really) What am I missing here?
Maybe try this: bk::generate(ostream_iterator<char>(cout), "Command line options not recognized:\n" << ('\"' << ba::string << '\"') % bk::eol) << bk::eol, vsUnrecog); You were doing a list of a list of a literal in such a way that cannot be done, cannot take a list of a literal. :p