- ValueList::const_iterator match =
- std::find(allowed_.begin(), allowed_.end(), values()[i]);
- GMX_ASSERT(match != allowed_.end(),
- "Enum value not found (internal error)");
- enumIndexStore_[i] = static_cast<int>(match - allowed_.begin());
+ if (values()[i].empty())
+ {
+ enumIndexStore_[i] = -1;
+ }
+ else
+ {
+ ValueList::const_iterator match =
+ std::find(allowed_.begin(), allowed_.end(), values()[i]);
+ GMX_ASSERT(match != allowed_.end(),
+ "Enum value not found (internal error)");
+ enumIndexStore_[i] = static_cast<int>(match - allowed_.begin());
+ }