diff --git a/include/cxxopts.hpp b/include/cxxopts.hpp index 76dcc1a..b24902a 100644 --- a/include/cxxopts.hpp +++ b/include/cxxopts.hpp @@ -138,11 +138,16 @@ toLocalString(std::string s) CXXOPTS_DIAGNOSTIC_PUSH CXXOPTS_IGNORE_WARNING("-Wnon-virtual-dtor") // This will be ignored under other compilers like LLVM clang. -class UnicodeStringIterator : public - std::iterator +class UnicodeStringIterator { public: + using iterator_category = std::forward_iterator_tag; + using value_type = int32_t; + using difference_type = std::ptrdiff_t; + using pointer = value_type*; + using reference = value_type&; + UnicodeStringIterator(const icu::UnicodeString* string, int32_t pos) : s(string) , i(pos) diff --git a/src/example.cpp b/src/example.cpp index c6da3a0..d7a2426 100644 --- a/src/example.cpp +++ b/src/example.cpp @@ -62,7 +62,7 @@ parse(int argc, const char* argv[]) ("tab-expansion", "Tab\texpansion") ("int", "An integer", cxxopts::value(), "N") ("float", "A floating point number", cxxopts::value()) - ("vector", "A list of doubles", cxxopts::value>()) + ("vector", "A list of doubles", cxxopts::value>()->default_value("")) ("option_that_is_too_long_for_the_help", "A very long option") ("l,list", "List all parsed arguments (including default values)") ("range", "Use range-for to list arguments")