cgal
cgal copied to clipboard
Check all Has_foo_bar traits classes
Issue Details
[lrineau@fernand]~% ack 'static const bool value.*sizeof' Git/cgal-master/^build*
Git/cgal-master/BGL/include/CGAL/boost/graph/internal/Has_member_clear.h
28: static const bool value = (sizeof(f<T>(0)) == sizeof(char));
Git/cgal-master/BGL/include/CGAL/boost/graph/internal/Has_member_id.h
28: static const bool value = (sizeof(char) == sizeof(check<Type>(0)));
Git/cgal-master/BGL/include/CGAL/boost/graph/split_graph_into_polylines.h
56: static const bool value = (sizeof(f<T>(0)) == sizeof(char));
Git/cgal-master/Box_intersection_d/include/CGAL/Box_intersection_d/segment_tree.h
325: static const bool value = (sizeof(f<T>(0)) == sizeof(char));
Git/cgal-master/Filtered_kernel/include/CGAL/Lazy_kernel.h
61: static const bool value = sizeof(test<T>(0)) == 1;
Git/cgal-master/Triangulation_2/include/CGAL/Constrained_triangulation_2.h
1853: static const bool value = (sizeof(char) == sizeof(check<Type>(0)));
- The implementation using expression-SFINAE, like in
BGL/include/CGAL/boost/graph/internal/Has_member_id.h, is the best. - The check functions should not use
charandint, because they might have the samesizeof. - Ideally, the two typedefs of different sizes should be named
YesandNo, for readability.