cmdopt: print enum names direct from name array

This commit is contained in:
Danny Robson 2016-03-11 19:16:55 +11:00
parent 6a6335163e
commit ffc3952113

View File

@ -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;