Commit 1bf66a40ff74c6e47c936a48dfc11ce1ed34af50
Merge pull request #9 from wichtounet/no_rtti
Macro to disable RTTI
Showing
1 changed file
with
4 additions
and
0 deletions
src/cxxopts.hpp
| ... | ... | @@ -500,7 +500,11 @@ namespace cxxopts |
| 500 | 500 | const T& |
| 501 | 501 | as() const |
| 502 | 502 | { |
| 503 | +#ifdef CXXOPTS_NO_RTTI | |
| 504 | + return static_cast<const values::default_value<T>&>(*m_value).get(); | |
| 505 | +#else | |
| 503 | 506 | return dynamic_cast<const values::default_value<T>&>(*m_value).get(); |
| 507 | +#endif | |
| 504 | 508 | } |
| 505 | 509 | |
| 506 | 510 | private: | ... | ... |