From fe4193f9ebef0927afe1873bca430b877c7b0fc3 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 13 May 2025 17:01:00 +0200 Subject: [PATCH] add a compatibility with std::execution::seq and co --- STL_Extension/include/CGAL/tags.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/STL_Extension/include/CGAL/tags.h b/STL_Extension/include/CGAL/tags.h index 8c446d8128d..fd4ef451317 100644 --- a/STL_Extension/include/CGAL/tags.h +++ b/STL_Extension/include/CGAL/tags.h @@ -19,6 +19,7 @@ #define CGAL_TAGS_H #include +#include namespace CGAL { @@ -96,4 +97,26 @@ struct Remove_needs_FT > } // namespace CGAL +#ifdef CGAL_LINKED_WITH_TBB +# include + +namespace CGAL { + constexpr auto std_execution_policy_aux(Sequential_tag) + { + return std::execution::seq; + } + constexpr auto std_execution_policy_aux(Parallel_tag) + { + return std::execution::par; + } + + template + inline constexpr auto std_execution_policy = std_execution_policy_aux(Tag{}); +} // namespace CGAL + +# define CGAL_MAYBE_EXEC_POLICY(Tag) CGAL::std_execution_policy, // with the comma +#else // not CGAL_LINKED_WITH_TBB +# define CGAL_MAYBE_EXEC_POLICY(Tag) +#endif // not CGAL_LINKED_WITH_TBB + #endif // CGAL_TAGS_H