ProgramOptions: Fixed warning about not all control paths returning a value

[SVN r53795]
This commit is contained in:
Hartmut Kaiser
2009-06-11 20:05:19 +00:00
parent 354717d9c9
commit 79b43138d6

View File

@@ -56,12 +56,11 @@ namespace boost { namespace program_options {
static std::basic_string<charT> empty;
if (v.size() > 1)
boost::throw_exception(validation_error("multiple values not allowed"));
if (v.size() == 1)
else if (v.size() == 1)
return v.front();
else if (allow_empty)
return empty;
else
boost::throw_exception(validation_error("at least one value required"));
else if (!allow_empty)
boost::throw_exception(validation_error("at least one value required"));
return empty;
}
/* Throws multiple_occurrences if 'value' is not empty. */