From d8645e87109d76b868f0d9b3cba72e2d9392df3a Mon Sep 17 00:00:00 2001 From: "Taylor C. Richberger" Date: Mon, 11 Jul 2016 14:30:37 -0600 Subject: bump version, change template use --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'README.md') 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& ints) #include -bool DoublesReader(const std::string &name, const std::string &value, std::tuple &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 &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) { -- cgit v1.2.1