diff options
author | Taylor C. Richberger <Taywee@gmx.com> | 2016-06-30 18:03:08 -0600 |
---|---|---|
committer | Taylor C. Richberger <Taywee@gmx.com> | 2016-06-30 18:03:08 -0600 |
commit | b041247bb713e9a223c3448189f0a9ea49c5e8b2 (patch) | |
tree | 96473dd88b605aa7f1387841016b4db108115941 /README.md | |
parent | give a little bit of doxygenation (diff) | |
download | args.hxx-b041247bb713e9a223c3448189f0a9ea49c5e8b2.tar.xz |
fix readme example
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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]") |