diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/macros.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/macros.h b/src/util/macros.h index e3c785af508..6d3df904082 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -285,4 +285,14 @@ do { \ #define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C)) #define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C)) +/** + * Macro for declaring an explicit conversion operator. Defaults to an + * implicit conversion if C++11 is not supported. + */ +#if __cplusplus >= 201103L +#define EXPLICIT_CONVERSION explicit +#elif defined(__cplusplus) +#define EXPLICIT_CONVERSION +#endif + #endif /* UTIL_MACROS_H */ |