diff --git a/src/cxxopts.hpp b/src/cxxopts.hpp index fe77a6b..d0057a9 100644 --- a/src/cxxopts.hpp +++ b/src/cxxopts.hpp @@ -586,7 +586,11 @@ namespace cxxopts const T& as() const { +#ifdef CXXOPTS_NO_RTTI + return static_cast&>(*m_value).get(); +#else return dynamic_cast&>(*m_value).get(); +#endif } private: