From 81f4714b1b6d7e6384975b0a02714c8f7424e529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 29 Dec 2016 10:25:11 +0100 Subject: [PATCH] mimic what is done for Has_clear typeof is an gcc extension --- .../boost/graph/split_graph_into_polylines.h | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h index adb9552c763..7c50bb16791 100644 --- a/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h +++ b/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h @@ -39,16 +39,26 @@ struct IsTerminalDefault } }; -template -class BGL_sgip_visitor_has_add_edge { - typedef char yes; - struct no { char t[2]; }; +template +class BGL_sgip_visitor_has_add_edge +{ +private: + template + class check {}; - template static yes test( typeof(&C::add_edge) ); - template static no test(...); + template + static char f(check*); + template + static char f(check*); + + template + static char f(check*); + + template + static int f(...); public: - enum { value = sizeof(test(0)) == sizeof(yes) }; + static const bool value = (sizeof(f(0)) == sizeof(char)); }; template @@ -57,6 +67,7 @@ bgl_sgip_maybe_call_visitor_add_edge_impl(Visitor&, Edge_descriptor, CGAL::Tag_false /*has_add_edge*/) { + } template @@ -71,7 +82,7 @@ bgl_sgip_maybe_call_visitor_add_edge_impl(Visitor& visitor, template void bgl_sgip_maybe_call_visitor_add_edge(Visitor& visitor, Edge_descriptor e) { - typedef BGL_sgip_visitor_has_add_edge Has_add_edge; + typedef BGL_sgip_visitor_has_add_edge Has_add_edge; bgl_sgip_maybe_call_visitor_add_edge_impl ( visitor, e, CGAL::Boolean_tag() ); }