Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost program_options
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-08-24 12:08:50


AMDG

Steve Nolen wrote:
>>>> I know the c standard calls for the argv in main's prototype to be
>>>> non-const, but why can't parse_command_line be more restrictive?
>>>>
>>>
>>>
>>
>> Because it that case, you won't be able to pass main's argv to parse_command_line.
>
> ok why not? you would be passing a non-const (main::argv) to a const qualified parameter. this would just guarantee that the function couldn't modify it (which is what you're telling me is the case here). i thought this was allowed.
>

No. The standard allows conversion from
char* to const char*, but not from char** to const char**.

In Christ,
Steven Watanabe


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