Skip to content

Commit cf09cfd

Browse files
committed
Merging fixes for #3909 to release branch
[SVN r68077]
1 parent ec3192a commit cf09cfd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
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>,

test/parsers_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void test_command_line()
131131
// Regression test: check that '0' as style is interpreted as
132132
// 'default_style'
133133
vector<option> a4 =
134-
parse_command_line(sizeof(cmdline3_)/sizeof(const char*), const_cast<char**>(cmdline3_),
134+
parse_command_line(sizeof(cmdline3_)/sizeof(const char*), cmdline3_,
135135
desc, 0, additional_parser).options;
136136

137137
BOOST_CHECK_EQUAL(a4.size(), 4u);

0 commit comments

Comments
 (0)