Boost logo

Boost Users :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-01-26 04:54:40


Merrill Cornish wrote:

> Steve,
>
> I ran into the same problem. Once I thought about it, I realized
> I had _never_ seen a C or C++ main() function prototype defined
> with a const second argument.
>
> I think I remember that one of the traditional C getopt() function
> variants actually munges the argument list by removing that
> arguments it recognizes, leaving anything else for direct processing
> by the program.
>
> I'm guessing program_options is therefore tacitly assuming the
> second argument is non-const also.

Simply, the standard says second argument of main is non-const. Using const
version is strictly speaking, invalid, and in practice I recall there were
some problems making both consts and non-const to work.

- 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