swap_2.cpp 211 B

1234567891011121314
  1. #include "../Eigen/Core"
  2. using namespace Eigen;
  3. int main()
  4. {
  5. VectorXf a(10), b(10);
  6. VectorXf const &ac(a);
  7. #ifdef EIGEN_SHOULD_FAIL_TO_BUILD
  8. b.swap(ac);
  9. #else
  10. b.swap(ac.const_cast_derived());
  11. #endif
  12. }