diff --git a/Surface_mesh_topology/include/CGAL/Shortest_noncontractible_cycle.h b/Surface_mesh_topology/include/CGAL/Shortest_noncontractible_cycle.h index 62e28548d4e..88400983cfe 100644 --- a/Surface_mesh_topology/include/CGAL/Shortest_noncontractible_cycle.h +++ b/Surface_mesh_topology/include/CGAL/Shortest_noncontractible_cycle.h @@ -15,20 +15,22 @@ public: using Dart_const_handle_orig = typename Gmap_origin::Dart_const_handle; template - struct Weight_functor_selector { - using Weight = T; + struct Weight_functor { using Weight = T; }; + + template + struct Weight_functor_selector : Weight_functor { }; + + template + struct Weight_functor_selector : Weight_functor { }; + + struct Default_weight_functor { + using Weight_t = unsigned int; + Weight_t operator() (Dart_const_handle_orig) const { return 1; } }; - template <> - struct Weight_functor_selector { - struct Weight { - using Weight_t = unsigned int; - Weight() {} - Weight_t operator() (Dart_const_handle_orig) const { return 1; } - }; - }; - - using Weight = typename Weight_functor_selector::Weight; + using Weight = typename Weight_functor_selector::value, + Default_weight_functor, + WeightFunctor>::Weight; using Distance_type = typename Weight::Weight_t; struct Attributes {