aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTaylor C. Richberger <Taywee@gmx.com>2016-07-11 14:30:37 -0600
committerTaylor C. Richberger <Taywee@gmx.com>2016-07-11 14:30:37 -0600
commitd8645e87109d76b868f0d9b3cba72e2d9392df3a (patch)
tree8869b1c1cadfd4e402ac730a736c4f917a05f0b4 /README.md
parentswitch pages to a submodule (diff)
downloadargs.hxx-d8645e87109d76b868f0d9b3cba72e2d9392df3a.tar.xz
bump version, change template use6.0.0
Diffstat (limited to 'README.md')
-rw-r--r--README.md14
1 files changed, 8 insertions, 6 deletions
diff --git a/README.md b/README.md
index 966eabd..b08f9f2 100644
--- a/README.md
+++ b/README.md
@@ -391,13 +391,15 @@ std::istream& operator>>(std::istream& is, std::tuple<int, int>& ints)
#include <args.hxx>
-bool DoublesReader(const std::string &name, const std::string &value, std::tuple<double, double> &destination)
+struct DoublesReader
{
- size_t commapos = 0;
- std::get<0>(destination) = std::stod(value, &commapos);
- std::get<1>(destination) = std::stod(std::string(value, commapos + 1));
- return true;
-}
+ void operator()(const std::string &name, const std::string &value, std::tuple<double, double> &destination)
+ {
+ size_t commapos = 0;
+ std::get<0>(destination) = std::stod(value, &commapos);
+ std::get<1>(destination) = std::stod(std::string(value, commapos + 1));
+ }
+};
int main(int argc, char **argv)
{