Commit 1bf66a40ff74c6e47c936a48dfc11ce1ed34af50

Authored by jarro2783
2 parents 1a558d76 164095cc

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,7 +500,11 @@ namespace cxxopts
500 const T& 500 const T&
501 as() const 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 return dynamic_cast<const values::default_value<T>&>(*m_value).get(); 506 return dynamic_cast<const values::default_value<T>&>(*m_value).get();
  507 +#endif
504 } 508 }
505 509
506 private: 510 private: