differentiate between cref and ref in compatibility wrapper

This commit is contained in:
Jane Tournois 2023-02-24 11:18:13 +01:00 committed by Mael Rouxel-Labbé
parent 39de8cb718
commit 036ddc57cc
2 changed files with 25 additions and 8 deletions

View File

@ -51,12 +51,15 @@ enum all_default_t { all_default };
enum X { Y };
#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \
enum X { Y };
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
enum X { Y };
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
enum X { Y };
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z)
#include <CGAL/STL_Extension/internal/parameters_interface.h>
#undef CGAL_add_named_parameter
#undef CGAL_add_named_parameter_with_compatibility
#undef CGAL_add_named_parameter_with_compatibility_cref_only
#undef CGAL_add_named_parameter_with_compatibility_ref_only
#undef CGAL_add_extra_named_parameter_with_compatibility
@ -359,7 +362,7 @@ struct Named_function_parameters
typedef Named_function_parameters<K, internal_np::X, self> Params;\
return Params(k, *this); \
}
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
template<typename K> \
Named_function_parameters<std::reference_wrapper<const K>, \
internal_np::X, self> \
@ -369,6 +372,16 @@ struct Named_function_parameters
internal_np::X, self> Params; \
return Params(std::cref(k), *this); \
}
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
template<typename K> \
Named_function_parameters<std::reference_wrapper<K>, \
internal_np::X, self> \
Z(K& k) const \
{ \
typedef Named_function_parameters<std::reference_wrapper<K>, \
internal_np::X, self> Params; \
return Params(std::ref(k), *this); \
}
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \
template<typename K> \
Named_function_parameters<K, internal_np::X, self> \
@ -380,6 +393,7 @@ struct Named_function_parameters
#include <CGAL/STL_Extension/internal/parameters_interface.h>
#undef CGAL_add_named_parameter
#undef CGAL_add_named_parameter_with_compatibility
#undef CGAL_add_named_parameter_with_compatibility_cref_only
#undef CGAL_add_named_parameter_with_compatibility_ref_only
#undef CGAL_add_extra_named_parameter_with_compatibility
@ -475,7 +489,7 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
template <typename K>
Named_function_parameters<std::reference_wrapper<K>, Tag>
operator=(K& p) const
operator=(std::reference_wrapper<K> p) const
{
typedef Named_function_parameters<std::reference_wrapper<K>, Tag> Params;
return Params(std::ref(p));
@ -494,6 +508,8 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
#define CGAL_add_named_parameter_with_compatibility(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X> Z;
#define CGAL_add_named_parameter_with_compatibility_cref_only(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X, true> Z;
#define CGAL_add_named_parameter_with_compatibility_ref_only(X, Y, Z) \
const Boost_parameter_compatibility_wrapper<internal_np::X, true> Z;
#define CGAL_add_extra_named_parameter_with_compatibility(X, Y, Z) \
@ -502,6 +518,7 @@ struct Boost_parameter_compatibility_wrapper<Tag, true>
#undef CGAL_add_named_parameter
#undef CGAL_add_extra_named_parameter_with_compatibility
#undef CGAL_add_named_parameter_with_compatibility
#undef CGAL_add_named_parameter_with_compatibility_cref_only
#undef CGAL_add_named_parameter_with_compatibility_ref_only
// Version with three parameters for dynamic property maps

View File

@ -306,7 +306,7 @@ CGAL_add_named_parameter_with_compatibility(mesh_param_t, mesh_param, mesh_optio
CGAL_add_named_parameter_with_compatibility(manifold_param_t, manifold_param, manifold_option)
CGAL_add_named_parameter_with_compatibility(features_option_param_t,features_options_param,features_options)
CGAL_add_named_parameter_with_compatibility_ref_only(image_3_param_t, image_3_param, image)
CGAL_add_named_parameter_with_compatibility_cref_only(image_3_param_t, image_3_param, image)
CGAL_add_named_parameter_with_compatibility(iso_value_param_t, iso_value_param, iso_value)
CGAL_add_named_parameter_with_compatibility(image_subdomain_index_t, image_subdomain_index, image_values_to_subdomain_indices)
CGAL_add_named_parameter_with_compatibility(voxel_value_t, voxel_value, value_outside)
@ -317,17 +317,17 @@ CGAL_add_named_parameter_with_compatibility(surface_patch_index_t, surface_patch
CGAL_add_named_parameter_with_compatibility_ref_only(weights_param_t, weights_param, weights)
CGAL_add_named_parameter_with_compatibility(edge_size_param_t, edge_size_param, edge_size)
CGAL_add_named_parameter_with_compatibility_ref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
CGAL_add_named_parameter_with_compatibility_cref_only(edge_sizing_field_param_t, edge_sizing_field_param, edge_sizing_field)
CGAL_add_named_parameter_with_compatibility(facet_angle_param_t, facet_angle_param, facet_angle)
CGAL_add_named_parameter_with_compatibility(facet_size_param_t, facet_size_param, facet_size)
CGAL_add_named_parameter_with_compatibility_ref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
CGAL_add_named_parameter_with_compatibility_ref_only(facet_distance_param_t, facet_distance_param, facet_distance)
CGAL_add_named_parameter_with_compatibility_cref_only(facet_sizing_field_param_t, facet_sizing_field_param, facet_sizing_field)
CGAL_add_named_parameter_with_compatibility_cref_only(facet_distance_param_t, facet_distance_param, facet_distance)
CGAL_add_named_parameter_with_compatibility(facet_topology_param_t, facet_topology_param, facet_topology)
CGAL_add_named_parameter_with_compatibility(cell_radius_edge_param_t, cell_radius_edge_param, cell_radius_edge)
CGAL_add_named_parameter_with_compatibility(cell_radius_edge_ratio_param_t, cell_radius_edge_ratio_param, cell_radius_edge_ratio)
CGAL_add_named_parameter_with_compatibility(cell_size_param_t, cell_size_param, cell_size)
CGAL_add_named_parameter_with_compatibility_ref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field)
CGAL_add_named_parameter_with_compatibility_ref_only(sizing_field_param_t, sizing_field_param, sizing_field)
CGAL_add_named_parameter_with_compatibility_cref_only(cell_sizing_field_param_t, cell_sizing_field_param, cell_sizing_field)
CGAL_add_named_parameter_with_compatibility_cref_only(sizing_field_param_t, sizing_field_param, sizing_field)
CGAL_add_named_parameter_with_compatibility(function_param_t, function_param, function)
CGAL_add_named_parameter_with_compatibility(bounding_object_param_t, bounding_object_param, bounding_object)