bug #903: clean swap API regarding extra enable_if parameters, and add failtests for swap

This commit is contained in:
Gael Guennebaud
2014-11-06 09:25:26 +01:00
parent c6fefe5d8e
commit 722916e19d
9 changed files with 61 additions and 31 deletions

14
failtest/swap_2.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include "../Eigen/Core"
using namespace Eigen;
int main()
{
VectorXf a(10), b(10);
VectorXf const &ac(a);
#ifdef EIGEN_SHOULD_FAIL_TO_BUILD
b.swap(ac);
#else
b.swap(ac.const_cast_derived());
#endif
}