From ba6fa48d31091a151b10dd47986602889731a893 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 25 Apr 2016 17:35:12 -0400 Subject: [PATCH] json/config.h: Generalize setting of JSONCPP_OVERRIDE to all compilers This commit has been adapted from InsightSoftwareConsortium/ITK@1c86090 --- include/json/config.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/json/config.h b/include/json/config.h index fc841b4..f86abc7 100644 --- a/include/json/config.h +++ b/include/json/config.h @@ -77,12 +77,14 @@ #endif // defined(_MSC_VER) -#if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010 -# define JSONCPP_OVERRIDE -#else +// In c++11 the override keyword allows you to explicity define that a function +// is intended to override the base-class version. This makes the code more +// managable and fixes a set of common hard-to-find bugs. +#if __cplusplus >= 201103L # define JSONCPP_OVERRIDE override -#endif // MSVC <= 2010 - +#else +# define JSONCPP_OVERRIDE +#endif #ifndef JSON_HAS_RVALUE_REFERENCES