Skip to content

Fix incorrect template declaration of lower_hull_points_2()/upper_hull_points_2() in Convex_hull_2 docs - #9575

Open
prajakta128 wants to merge 1 commit into
CGAL:mainfrom
prajakta128:fix-lower-upper-hull-points-2-doc
Open

Fix incorrect template declaration of lower_hull_points_2()/upper_hull_points_2() in Convex_hull_2 docs#9575
prajakta128 wants to merge 1 commit into
CGAL:mainfrom
prajakta128:fix-lower-upper-hull-points-2-doc

Conversation

@prajakta128

@prajakta128 prajakta128 commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Fixes an inconsistency in the documentation of CGAL::lower_hull_points_2() and CGAL::upper_hull_points_2() in the Convex_hull_2 package. This is a documentation-only change with no impact on compiled code or the public API.

Problem

In Convex_hull_2/doc/Convex_hull_2/CGAL/convex_hull_2.h, both functions were declared with a template parameter list that did not match the symbols used in the declaration body:

template <class InputIterator, class OutputIterator>
OutputIterator
lower_hull_points_2(InputIterator first, InputIterator beyond,
                    OutputIterator result,
                    const Traits& ch_traits = Default_traits );

Two problems here:

  1. Traits is used as a type in const Traits& ch_traits, but Traits is not declared in the template parameter list (class Traits is missing).
  2. = Default_traits is given as a default value, but Default_traits is not defined anywhere in the codebase.

The same issue was present for upper_hull_points_2().

Root cause

Comparing against the real implementation in Convex_hull_2/include/CGAL/convex_hull_2.h, these functions actually have two separate overloads:

// Overload 1: explicit traits class
template <class InputIterator, class OutputIterator, class Traits>
OutputIterator
lower_hull_points_2(InputIterator first, InputIterator last,
                    OutputIterator result, const Traits& ch_traits);

// Overload 2: traits deduced from the point's kernel
template <class ForwardIterator, class OutputIterator>
OutputIterator
lower_hull_points_2(ForwardIterator first, ForwardIterator last,
                    OutputIterator result);

The documentation had incorrectly merged these two distinct overloads into a single, malformed declaration instead of documenting them separately — unlike convex_hull_2() earlier in the same file, which correctly documents both overloads independently.

Fix

Split the doc declaration of lower_hull_points_2() and upper_hull_points_2() into two properly-templated declarations each, mirroring the existing correct pattern used for convex_hull_2():

  • One overload takes an explicit Traits parameter (template <class InputIterator, class OutputIterator, class Traits>).
  • One overload omits it and documents that the traits/kernel is deduced via std::iterator_traits and CGAL::Kernel_traits (template <class InputIterator, class OutputIterator>).

Verification

  • Confirmed by cross-referencin Convex_hull_2/include/CGAL/convex_hull_2.h (actual implementation against the doc stub — the two-overload structure matches exactly.
  • grep -n "Default_traits\|class Traits" on the modified file no shows class Traits only inside correctly-formed template paramete lists, and no remaining reference to the undefined Default_traits.
  • This is a doc-only file consumed by Doxygen; it does not affect compilation of the library or examples.

Type of change

  • Documentation fix
  • Bug fix (code)
  • New feature

Fixes #9574

…_hull_points_2() in docs

Split the malformed single declaration (which referenced an undeclared
'Traits' type and undefined 'Default_traits' default) into two correct
overload declarations, matching the actual implementation in
Convex_hull_2/include/CGAL/convex_hull_2.h and the existing pattern
used for convex_hull_2() earlier in this same file.

Fixes CGAL#9574
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Convex_hull_2: incorrect/inconsistent template declaration of lower_hull_points_2() and upper_hull_points_2() in documentation

1 participant