add a compatibility with std::execution::seq and co

This commit is contained in:
Laurent Rineau 2025-05-13 17:01:00 +02:00
parent fba1b5068e
commit fe4193f9eb
1 changed files with 23 additions and 0 deletions

View File

@ -19,6 +19,7 @@
#define CGAL_TAGS_H
#include <CGAL/IO/io_tags.h>
#include <type_traits>
namespace CGAL {
@ -96,4 +97,26 @@ struct Remove_needs_FT<Needs_FT<T> >
} // namespace CGAL
#ifdef CGAL_LINKED_WITH_TBB
# include <execution>
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 <typename Tag>
inline constexpr auto std_execution_policy = std_execution_policy_aux(Tag{});
} // namespace CGAL
# define CGAL_MAYBE_EXEC_POLICY(Tag) CGAL::std_execution_policy<Tag>, // 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