diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-02-24 18:13:49 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-02-24 18:13:49 +0100 |
commit | 9fdc6258cfac14b6cee30f63047d2b63c87e69d9 (patch) | |
tree | 2f008bee226f1ada9838664ad2cd68f3db75c1f2 /Eigen/src/Core/util | |
parent | 21fecd5252061c05cfb9f91e4e9becf25089949d (diff) |
Implement bug #317: use a template function call to suppress unused variable warnings. This also fix the issue of the previous changeset in a much nicer way.
Diffstat (limited to 'Eigen/src/Core/util')
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index debc04f3f..f69fc5ec4 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -252,7 +252,12 @@ #endif // Suppresses 'unused variable' warnings. -#define EIGEN_UNUSED_VARIABLE(var) (void)var; +namespace Eigen { + namespace internal { + template<typename T> void ignore_unused_variable(const T&) {} + } +} +#define EIGEN_UNUSED_VARIABLE(var) Eigen::internal::ignore_unused_variable(var); #if !defined(EIGEN_ASM_COMMENT) #if (defined __GNUC__) && ( defined(__i386__) || defined(__x86_64__) ) |