cmdopt: add value option accessor

This commit is contained in:
Danny Robson 2015-06-30 22:08:07 +10:00
parent 35718cbcf7
commit 8038e40f62
2 changed files with 10 additions and 0 deletions

View File

@ -84,6 +84,7 @@ namespace util { namespace cmdopt {
T data (void) const;
T& data (void);
T& data (T);
private:
T& m_data;

View File

@ -71,6 +71,15 @@ namespace util { namespace cmdopt {
}
//-----------------------------------------------------------------------------
template <typename T>
T&
option::value<T>::data (T _data)
{
return m_data = _data;
}
///////////////////////////////////////////////////////////////////////////
template <typename T, typename ...Args>
T&