diff --git a/cmdopt.cpp b/cmdopt.cpp index 5ab3d2d2..ec876652 100644 --- a/cmdopt.cpp +++ b/cmdopt.cpp @@ -85,10 +85,17 @@ namespace util { namespace cmdopt { namespace option { /////////////////////////////////////////////////////////////////////////////// template +count::count (std::string _name, T &_data): + value (std::move (_name), _data) +{ ; } + + +//------------------------------------------------------------------------- +template void count::execute (void) { - ++ this->data(); + ++this->data (); } diff --git a/cmdopt.hpp b/cmdopt.hpp index 3f17e18c..56e642ce 100644 --- a/cmdopt.hpp +++ b/cmdopt.hpp @@ -62,7 +62,7 @@ namespace util { namespace cmdopt { template class count : public value { public: - count (std::string name); + count (std::string name, T&); using value::execute; void execute (void) override;