From 2c083ace3ecec6c2894f41d96d6c2b7a48dff7e2 Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Mon, 24 Sep 2018 18:01:17 +0200 Subject: Provide EIGEN_OVERRIDE and EIGEN_FINAL macros to mark virtual function overrides --- Eigen/src/Core/util/Macros.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Eigen/src/Core/util/Macros.h') diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 3af6c4e37..dd4866724 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -638,6 +638,15 @@ #endif #endif +#ifndef EIGEN_HAS_CXX11_OVERRIDE_FINAL + #if EIGEN_MAX_CPP_VER>=11 && \ + (__cplusplus >= 201103L || EIGEN_COMP_MSVC >= 1700) + #define EIGEN_HAS_CXX11_OVERRIDE_FINAL 1 + #else + #define EIGEN_HAS_CXX11_OVERRIDE_FINAL 0 + #endif +#endif + #if defined(EIGEN_CUDACC) && EIGEN_HAS_CONSTEXPR // While available already with c++11, this is useful mostly starting with c++14 and relaxed constexpr rules #if defined(__NVCC__) @@ -1095,6 +1104,15 @@ bool all(T t, Ts ... ts){ return t && all(ts...); } } #endif +#if EIGEN_HAS_CXX11_OVERRIDE_FINAL +// provide override and final specifiers if they are available: +# define EIGEN_OVERRIDE override +# define EIGEN_FINAL final +#else +# define EIGEN_OVERRIDE +# define EIGEN_FINAL +#endif + // Wrapping #pragma unroll in a macro since it is required for SYCL #if defined(__SYCL_DEVICE_ONLY__) #if defined(_MSC_VER) -- cgit v1.2.3