Skip to content

Commit e3f331a

Browse files
committed
Take argv as const; refs #3909
[SVN r66959]
1 parent b000bf9 commit e3f331a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/boost/program_options/detail/parsers.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ namespace boost { namespace program_options {
3636

3737
template<class charT>
3838
basic_command_line_parser<charT>::
39-
basic_command_line_parser(int argc, charT* argv[])
39+
basic_command_line_parser(int argc, const charT* const argv[])
4040
: detail::cmdline(
4141
// Explicit template arguments are required by gcc 3.3.1
4242
// (at least mingw version), and do no harm on other compilers.
43-
to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc+!argc)))
43+
to_internal(detail::make_vector<charT, const charT* const*>(argv+1, argv+argc+!argc)))
4444
{}
4545

4646

@@ -111,7 +111,7 @@ namespace boost { namespace program_options {
111111

112112
template<class charT>
113113
basic_parsed_options<charT>
114-
parse_command_line(int argc, charT* argv[],
114+
parse_command_line(int argc, const charT* const argv[],
115115
const options_description& desc,
116116
int style,
117117
function1<std::pair<std::string, std::string>,

include/boost/program_options/parsers.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ namespace boost { namespace program_options {
100100
/** Creates a command line parser for the specified arguments
101101
list. The parameters should be the same as passed to 'main'.
102102
*/
103-
basic_command_line_parser(int argc, charT* argv[]);
103+
basic_command_line_parser(int argc, const charT* const argv[]);
104104

105105
/** Sets options descriptions to use. */
106106
basic_command_line_parser& options(const options_description& desc);
@@ -144,7 +144,7 @@ namespace boost { namespace program_options {
144144
*/
145145
template<class charT>
146146
basic_parsed_options<charT>
147-
parse_command_line(int argc, charT* argv[],
147+
parse_command_line(int argc, const charT* const argv[],
148148
const options_description&,
149149
int style = 0,
150150
function1<std::pair<std::string, std::string>,

0 commit comments

Comments
 (0)