Skip to content

Commit 4acedf1

Browse files
Surface_mesh: remove obsolete g++4.4 workaround from SM_Halfedge_index
CGAL 6.0 raised the minimum compiler requirement to GCC 11.4 (and equivalently for Clang/MSVC). The work around that was added to SM_Halfedge_index to paper over a g++ 4.4 ADL bug for 'std::next' lookups is therefore no longer needed. The workaround added five 'typedef void' members (iterator_category, value_type, difference_type, pointer, reference) to SM_Halfedge_index so that it superficially looked like a legacy input-iterator. This tricked g++ 4.4's ADL machinery into skipping the std::next overload set when an SM_Halfedge_index was an argument, but it has the unwanted side-effect of satisfying the legacy iterator_traits check inside pybind11. Specifically, pybind11::detail::is_move_constructible<SM_Halfedge_index> evaluates as false because pybind11 inspects value_type and, finding 'void', concludes the type is not a proper value type and therefore not move- constructible -- contradicting std::move_constructible<SM_Halfedge_index> which correctly evaluates as true. Fix: remove the five typedef void members and the comment explaining them. No other code in the CGAL codebase depends on these typedefs. Fixes #9319
1 parent 058401a commit 4acedf1

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,6 @@ namespace CGAL {
162162
{
163163
public:
164164

165-
// Workaround for a bug in g++4.4 in ADL for function next:
166-
// we provide the types needed for std::iterator_traits<Surface_mesh::halfedge_index>,
167-
// although this descriptor is not an iterator.
168-
typedef void iterator_category;
169-
typedef void value_type;
170-
typedef void difference_type;
171-
typedef void pointer;
172-
typedef void reference;
173-
174165
SM_Halfedge_index() : SM_Index<SM_Halfedge_index>((std::numeric_limits<size_type>::max)()) {}
175166

176167
explicit SM_Halfedge_index(size_type _idx) : SM_Index<SM_Halfedge_index>(_idx) {}

0 commit comments

Comments
 (0)