diff --git a/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h b/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h index 62cbed028f1..b10f55e321b 100644 --- a/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h +++ b/Mesh_3/include/CGAL/internal/Mesh_3/indices_management.h @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -59,17 +58,66 @@ struct Index_generator typedef Index type; }; +// Nasty meta-programming to get a boost::variant of four types that +// may not be all different. +template struct seq1 { + typedef T0 type; +}; +template struct seq2 { + typedef boost::variant type; +}; +template struct seq3 { + typedef boost::variant type; +}; +template struct seq4 { + typedef boost::variant type; +}; + +template struct insert; +template struct insert, U> { + typedef seq2 type; +}; +template struct insert, V> { + typedef seq3 type; +}; +template +struct insert, W> { + typedef seq4 type; +}; +template struct insert, T> { + typedef seq1 type; +}; +template struct insert, T> { + typedef seq2 type; +}; +template struct insert, U> { + typedef seq2 type; +}; +template struct insert, T> { + typedef seq3 type; +}; +template struct insert, U> { + typedef seq3 type; +}; +template struct insert, V> { + typedef seq3 type; +}; + template < typename Subdomain_index, typename Surface_patch_index, typename Curves_index, typename Corner_index> struct Index_generator_with_features { - typedef boost::mpl::set4 Set; - typedef typename boost::make_variant_over::type Index; + typedef typename insert< + typename insert< + typename insert, + Surface_patch_index + >::type, + Curves_index + >::type, + Corner_index>::type seq; + typedef typename seq::type Index; typedef Index type; };