cmdopt: print enum names direct from name array
This commit is contained in:
parent
6a6335163e
commit
ffc3952113
@ -76,9 +76,9 @@ namespace util { namespace cmdopt {
|
|||||||
{
|
{
|
||||||
static const std::string EXAMPLE = [] (void) {
|
static const std::string EXAMPLE = [] (void) {
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
std::copy (std::cbegin (enum_values<T>::values),
|
std::copy (std::cbegin (enum_traits<T>::names),
|
||||||
std::cend (enum_values<T>::values),
|
std::cend (enum_traits<T>::names),
|
||||||
infix_iterator<T> (os, "|"));
|
infix_iterator<const char*> (os, "|"));
|
||||||
return os.str ();
|
return os.str ();
|
||||||
} ();
|
} ();
|
||||||
return EXAMPLE;
|
return EXAMPLE;
|
||||||
|
Loading…
Reference in New Issue
Block a user