cmdopt: add count constructor

This commit is contained in:
Danny Robson 2015-06-15 17:47:18 +10:00
parent 544d4d9624
commit 79a936b583
2 changed files with 9 additions and 2 deletions

View File

@ -85,10 +85,17 @@ namespace util { namespace cmdopt { namespace option {
///////////////////////////////////////////////////////////////////////////////
template <typename T>
count<T>::count (std::string _name, T &_data):
value<T> (std::move (_name), _data)
{ ; }
//-------------------------------------------------------------------------
template <typename T>
void
count<T>::execute (void)
{
++ this->data();
++this->data ();
}

View File

@ -62,7 +62,7 @@ namespace util { namespace cmdopt {
template <typename T = unsigned>
class count : public value<T> {
public:
count (std::string name);
count (std::string name, T&);
using value<T>::execute;
void execute (void) override;