From d5592717618195d3b980eae3dd6bee8e888971e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20M=C3=B6ller?= Date: Tue, 2 Feb 2016 18:22:50 +0100 Subject: [PATCH] Add trickery for default template arguments --- .../CGAL/boost/graph/copy_face_graph.h | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index 4d96fea4e1b..e961c6a874c 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -32,7 +32,9 @@ namespace CGAL { /*! \ingroup PkgBGLHelperFct - copies a source FaceGraph into another FaceGraph of different type. + copies a source FaceGraph into another FaceGraph of different + type. OutputIterators can be provided to produce a mapping between + source and target elements. \tparam SourceMesh a `FaceListGraph` \tparam TargetMesh a `FaceListGraph` @@ -54,11 +56,19 @@ namespace CGAL { `vertex_point` and that the `vertex_point` values of `tm` are constructible from the ones of `sm`. */ -template -void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, - V2V v2v = Emptyset_iterator(), - H2H h2h = Emptyset_iterator(), - F2F f2f = Emptyset_iterator()) +#if defined(CGAL_CXX11) || defined(DOXYGEN_RUNNING) // Use template default arguments +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, + V2V v2v = V2V(), H2H h2h = H2H(), F2F f2f = F2F()) +#else // use the overloads +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, + V2V v2v, H2H h2h, F2F f2f) +#endif { typedef typename boost::graph_traits::vertex_descriptor sm_vertex_descriptor; typedef typename boost::graph_traits::vertex_descriptor tm_vertex_descriptor; @@ -114,6 +124,20 @@ void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, } +#if !defined(CGAL_CXX11) +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm) +{ copy_face_graph(sm, tm, Emptyset_iterator(), Emptyset_iterator(), Emptyset_iterator()); } + +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v) +{ copy_face_graph(sm, tm, v2v, Emptyset_iterator(), Emptyset_iterator()); } + +template +void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v, H2H h2h) +{ copy_face_graph(sm, tm, v2v, h2h, Emptyset_iterator()); } +#endif + } // namespace CGAL #endif // CGAL_BOOST_GRAPH_COPY_FACE_GRAPH_H