Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2007-02-24 02:34:12


n.torrey.pines wrote:

> In VC++2005 debug mode (Ctrl-F5), this little program aborts:
>
>
> +++++++++++++ begin ++++++++++++++++++++++++
> #include <iostream>
> #include <boost/program_options.hpp>
>
> int main(int argc, char * argv[]) {
> boost::program_options::options_description desc("Allowed options");
> desc.add_options()
> ("some_option", "\
> This option description SHOULD be long enough not to fit in one line");
> std::cout << desc << '\n';
> }
> ++++++++++++ end +++++++++++++++++++++++++++
>
> The debug assertion failure message is:
>
> File: C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xstring
> Line: 173
>
>
> Through multiple trials, I found that the error occurs if and only if
> the option description is long enough not to fit in one line in the
> window.
>
> This is boost-1_33_1
>
> Since I have no prior experience with program_options, perhaps I'm using
> it incorrectly?

This is a combination of somewhat sloppy code in the formatting code,
and somewhat unreasonable runtime checking in VC++2005. This is supposed to
be fixed in CVS, can you try it?

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net