aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor C. Richberger <Taywee@gmx.com>2016-06-30 18:03:08 -0600
committerTaylor C. Richberger <Taywee@gmx.com>2016-06-30 18:03:08 -0600
commitb041247bb713e9a223c3448189f0a9ea49c5e8b2 (patch)
tree96473dd88b605aa7f1387841016b4db108115941
parentgive a little bit of doxygenation (diff)
downloadargs.hxx-b041247bb713e9a223c3448189f0a9ea49c5e8b2.tar.xz
fix readme example
-rw-r--r--README.md6
1 files changed, 4 insertions, 2 deletions
diff --git a/README.md b/README.md
index 0ac02e4..2bac1ce 100644
--- a/README.md
+++ b/README.md
@@ -381,11 +381,12 @@ std::istream& operator>>(std::istream& is, std::tuple<int, int>& ints)
#include <args.hxx>
-void DoublesReader(const std::string &name, const std::string &value, std::tuple<double, double> &destination)
+bool DoublesReader(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));
+ return true;
}
int main(int argc, char **argv)
@@ -751,10 +752,11 @@ int main(int argc, char **argv)
I haven't written out a long example for this, but here's the test case you should be able to discern the meaning from:
```cpp
-void ToLowerReader(const std::string &name, const std::string &value, std::string &destination)
+bool ToLowerReader(const std::string &name, const std::string &value, std::string &destination)
{
destination = value;
std::transform(destination.begin(), destination.end(), destination.begin(), ::tolower);
+ return true;
}
TEST_CASE("Mapping types work as needed", "[args]")