File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
include/boost/program_options Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ namespace boost { namespace program_options {
2424 basic_command_line_parser<charT>::
2525 basic_command_line_parser (int argc, const charT* const argv[])
2626 : detail::cmdline(
27- to_internal (std::vector<std::basic_string<charT> >(argv+1 , argv+argc))),
27+ to_internal (std::vector<std::basic_string<charT> >(argc ? argv+1 : argv , argv+argc))),
2828 m_desc()
2929 {}
3030
Original file line number Diff line number Diff line change @@ -120,7 +120,11 @@ namespace boost { namespace program_options {
120120 basic_command_line_parser (const std::vector<
121121 std::basic_string<charT> >& args);
122122 /* * Creates a command line parser for the specified arguments
123- list. The parameters should be the same as passed to 'main'.
123+ list. The parameters should be the same as passed to 'main', meaning:
124+ @param argc Must be non-negative i.e. >= 0
125+ @param argv Argv[argc] must be 0 e.g. nullptr and
126+ if argc is >0 argv[0] up to argv[argc-1] must point to
127+ null terminated strings
124128 */
125129 basic_command_line_parser (int argc, const charT* const argv[]);
126130
You can’t perform that action at this time.
0 commit comments