From 0a6eecd28de128db43f3ccd87ea180ef7adb6e15 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 20 Nov 2025 09:52:12 +0100 Subject: [PATCH] explain why NDEBUG must not be defined --- STL_Extension/examples/STL_Extension/bisect_failures.cpp | 9 +++++++++ STL_Extension/include/CGAL/bisect_failures.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/STL_Extension/examples/STL_Extension/bisect_failures.cpp b/STL_Extension/examples/STL_Extension/bisect_failures.cpp index b4c0d8302af..8985507db11 100644 --- a/STL_Extension/examples/STL_Extension/bisect_failures.cpp +++ b/STL_Extension/examples/STL_Extension/bisect_failures.cpp @@ -1,3 +1,12 @@ +// CGAL::bisect_failures requires the code to be compiled with assertions +// enabled. That means NDEBUG and CGAL_NDEBUG should not be defined. +#if defined(NDEBUG) +# undef NDEBUG +#endif +#if defined(CGAL_NDEBUG) +# undef CGAL_NDEBUG +#endif + #include #include #include diff --git a/STL_Extension/include/CGAL/bisect_failures.h b/STL_Extension/include/CGAL/bisect_failures.h index 565631a6cf8..7a9ce1aa835 100644 --- a/STL_Extension/include/CGAL/bisect_failures.h +++ b/STL_Extension/include/CGAL/bisect_failures.h @@ -72,6 +72,10 @@ namespace CGAL { * 8. Repeats until no further simplification is possible (minimal failing case found) * 9. Saves the minimal failing case as "final_bad" and returns its exit code * + * \warning CGAL::bisect_failures requires the tested code to be compiled with + * assertions enabled. That means NDEBUG and CGAL_NDEBUG should not be defined. + * + * Here is an example of how to use `CGAL::bisect_failures`: * \snippet STL_Extension/bisect_failures.cpp bisect_failures_snippet */ template