-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Default property maps for named parameters #2814
Description
Now that we have dynamic property maps, I wonder whether we should use them for functions that require properties.
If we take the example of copy_face_graph() or connected_components(), they require some index property maps. Everything goes well if the graph type has internal maps but this will lead to a compilation issue with Polyhedron_3 if no named parameter is passed.
What we could do is to check if there is an internal property map (using CGAL::graph_has_property) and if not use a dynamic property instead. If we want to prevent this from being automatic (so that the user is aware that an unordered map will be used) we could make the named parameter accept Default to trigger the creation of a dynamic property map.
Implementation wise, all that mechanism could be hidden in a helper (responsible for choosing either the internal property map or the dynamic one).
Opinions?
CC @CGAL/geometryfactory
Remember that there is also #1918 that is somehow related (because dynamic pmap must be initialized).