Skip to content

Commit 8bd4f94

Browse files
committed
Merge pull request open-source-parsers#467 from jcfr/generalize-setting-of-JSONCPP_OVERRIDE
json/config.h: Generalize setting of JSONCPP_OVERRIDE to all compilers
2 parents 4018422 + ba6fa48 commit 8bd4f94

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

include/json/config.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@
7777

7878
#endif // defined(_MSC_VER)
7979

80-
#if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010
81-
# define JSONCPP_OVERRIDE
82-
#else
80+
// In c++11 the override keyword allows you to explicity define that a function
81+
// is intended to override the base-class version. This makes the code more
82+
// managable and fixes a set of common hard-to-find bugs.
83+
#if __cplusplus >= 201103L
8384
# define JSONCPP_OVERRIDE override
84-
#endif // MSVC <= 2010
85-
85+
#else
86+
# define JSONCPP_OVERRIDE
87+
#endif
8688

8789
#ifndef JSON_HAS_RVALUE_REFERENCES
8890

0 commit comments

Comments
 (0)