From 164095cc0c1d904501a797d5ae05334888ff56f9 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Wed, 29 Oct 2014 17:52:30 +0100 Subject: [PATCH] Macro to disable RTTI --- src/cxxopts.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cxxopts.hpp b/src/cxxopts.hpp index 4f4fe7b..146b0d6 100644 --- a/src/cxxopts.hpp +++ b/src/cxxopts.hpp @@ -500,7 +500,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: