mirror of https://github.com/CGAL/cgal
add a compatibility with std::execution::seq and co
This commit is contained in:
parent
fba1b5068e
commit
fe4193f9eb
|
|
@ -19,6 +19,7 @@
|
||||||
#define CGAL_TAGS_H
|
#define CGAL_TAGS_H
|
||||||
|
|
||||||
#include <CGAL/IO/io_tags.h>
|
#include <CGAL/IO/io_tags.h>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
@ -96,4 +97,26 @@ struct Remove_needs_FT<Needs_FT<T> >
|
||||||
|
|
||||||
} // namespace CGAL
|
} // 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
|
#endif // CGAL_TAGS_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue