From aef04b7dcefd0e1d4d3b1eb8c38cc145baf645dc Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 17 Aug 2015 12:08:50 +0200 Subject: [PATCH] make compilation more explicit when Eigen < 3.2 is used --- .../include/CGAL/Polygon_mesh_processing/fair.h | 7 +++++++ .../internal/named_params_helper.h | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h index 4fa38d88ff4..0a74ed1153a 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/fair.h @@ -29,6 +29,7 @@ #include // for sparse linear system solver #endif +#include namespace CGAL { @@ -122,6 +123,12 @@ namespace internal { //if no solver is provided and Eigen version < 3.2 #endif + typedef typename GetSolver::type SparseLinearSolver; + if (boost::is_same::value) + { + BOOST_STATIC_ASSERT_MSG(EIGEN_VERSION_AT_LEAST(3, 2, 0), + "The function `fair` requires Eigen3 version 3.2 or later."); + } typedef typename GetVertexPointMap < PolygonMesh, NamedParameters>::type VPMap; typedef CGAL::internal::Cotangent_weight_with_voronoi_area_fairing Default_Weight_calculator; diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h index df4bdf685e2..c17daf4a0f9 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/named_params_helper.h @@ -100,6 +100,17 @@ public: > ::type type; }; +template +class GetSolver +{ +public: + typedef typename boost::lookup_named_param_def < + CGAL::sparse_linear_solver_t, + NamedParameters, + DefaultSolver + > ::type type; +}; + #endif //CGAL_NAMED_PARAMETERS_HELPERS_H