Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost program_options
From: Ilya Sokolov (ilyasokol_at_[hidden])
Date: 2009-08-25 04:56:47


Steven Watanabe wrote:
> 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**.

But it allows conversion from char** to const char* const*.


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