|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53795 - trunk/boost/program_options/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-06-11 16:05:20
Author: hkaiser
Date: 2009-06-11 16:05:19 EDT (Thu, 11 Jun 2009)
New Revision: 53795
URL: http://svn.boost.org/trac/boost/changeset/53795
Log:
ProgramOptions: Fixed warning about not all control paths returning a value
Text files modified:
trunk/boost/program_options/detail/value_semantic.hpp | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
Modified: trunk/boost/program_options/detail/value_semantic.hpp
==============================================================================
--- trunk/boost/program_options/detail/value_semantic.hpp (original)
+++ trunk/boost/program_options/detail/value_semantic.hpp 2009-06-11 16:05:19 EDT (Thu, 11 Jun 2009)
@@ -56,12 +56,11 @@
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. */
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk