updated boost on windows
This commit is contained in:
@@ -136,7 +136,7 @@ namespace boost { namespace program_options { namespace detail {
|
||||
const std::vector<style_parser>& style_parsers);
|
||||
|
||||
// Copies of input.
|
||||
std::vector<std::string> args;
|
||||
std::vector<std::string> m_args;
|
||||
style_t m_style;
|
||||
bool m_allow_unregistered;
|
||||
|
||||
|
||||
@@ -12,20 +12,6 @@
|
||||
|
||||
namespace boost { namespace program_options {
|
||||
|
||||
namespace detail {
|
||||
template<class charT, class Iterator>
|
||||
std::vector<std::basic_string<charT> >
|
||||
make_vector(Iterator i, Iterator e)
|
||||
{
|
||||
std::vector<std::basic_string<charT> > result;
|
||||
// Some compilers don't have templated constructor for
|
||||
// vector, so we can't create vector from (argv+1, argv+argc) range
|
||||
for(; i != e; ++i)
|
||||
result.push_back(*i);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
template<class charT>
|
||||
basic_command_line_parser<charT>::
|
||||
basic_command_line_parser(const std::vector<
|
||||
@@ -38,9 +24,7 @@ namespace boost { namespace program_options {
|
||||
basic_command_line_parser<charT>::
|
||||
basic_command_line_parser(int argc, const charT* const argv[])
|
||||
: detail::cmdline(
|
||||
// Explicit template arguments are required by gcc 3.3.1
|
||||
// (at least mingw version), and do no harm on other compilers.
|
||||
to_internal(detail::make_vector<charT, const charT* const*>(argv+1, argv+argc+!argc))),
|
||||
to_internal(std::vector<std::basic_string<charT> >(argv+1, argv+argc))),
|
||||
m_desc()
|
||||
{}
|
||||
|
||||
@@ -49,7 +33,7 @@ namespace boost { namespace program_options {
|
||||
basic_command_line_parser<charT>&
|
||||
basic_command_line_parser<charT>::options(const options_description& desc)
|
||||
{
|
||||
detail::cmdline::set_options_description(desc);
|
||||
detail::cmdline::set_options_description(desc);
|
||||
m_desc = &desc;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
// forward declaration
|
||||
namespace boost { template<class T> class optional; }
|
||||
|
||||
namespace boost { namespace program_options {
|
||||
|
||||
extern BOOST_PROGRAM_OPTIONS_DECL std::string arg;
|
||||
@@ -152,6 +155,20 @@ namespace boost { namespace program_options {
|
||||
}
|
||||
}
|
||||
|
||||
/** Validates optional arguments. */
|
||||
template<class T, class charT>
|
||||
void validate(boost::any& v,
|
||||
const std::vector<std::basic_string<charT> >& s,
|
||||
boost::optional<T>*,
|
||||
int)
|
||||
{
|
||||
validators::check_first_occurrence(v);
|
||||
validators::get_single_string(s);
|
||||
boost::any a;
|
||||
validate(a, s, (T*)0, 0);
|
||||
v = boost::any(boost::optional<T>(boost::any_cast<T>(a)));
|
||||
}
|
||||
|
||||
template<class T, class charT>
|
||||
void
|
||||
typed_value<T, charT>::
|
||||
|
||||
Reference in New Issue
Block a user