24 #ifndef ARM_COMPUTE_UTILS_ENUMOPTION
25 #define ARM_COMPUTE_UTILS_ENUMOPTION
55 EnumOption(std::string
name, std::set<T> allowed_values, T default_value);
58 std::string
help()
const override;
64 const T &
value()
const;
67 std::set<T> _allowed_values{};
72 :
SimpleOption<T>{std::move(
name)}, _allowed_values{std::move(allowed_values)}
78 :
SimpleOption<T>{std::move(
name), std::move(default_value)}, _allowed_values{std::move(allowed_values)}
87 std::stringstream stream{value};
90 stream >> typed_value;
94 if (_allowed_values.count(typed_value) == 0)
99 this->_value = std::move(typed_value);
100 this->_is_set =
true;
106 catch (
const std::invalid_argument &)
112 template <
typename T>
115 std::stringstream msg;
116 msg <<
"--" + this->
name() +
"={";
118 for (
const auto &value : _allowed_values)
123 msg <<
"} - " << this->_help;
128 template <
typename T>