Open TobyBrull opened 3 weeks ago
Would be nice to have a function similar to "as" that returns an optional if no value is set. Something like
class OptionValue { ... template <typename T> std::optional<T> as_optional() const { if (m_value == nullptr) { return std::nullopt; } else { return CXXOPTS_RTTI_CAST<const values::standard_value<T>&>(*m_value).get(); } } ... };
Is Pull #421 what you're looking for?
Would be nice to have a function similar to "as" that returns an optional if no value is set. Something like