Skip to content

Document Concurrent_tag::is_parallel? #9371

@lrineau

Description

@lrineau

In PR #9274, I have added a value in Parallel_tag and Sequential_tag:

// For concurrency
struct Sequential_tag { static constexpr bool is_parallel = false; };
struct Parallel_tag : public Sequential_tag { static constexpr bool is_parallel = true; };

That is the equivalent of Tag::value when Tag is a Boolean tag, like:

  • CGAL::Boolean_tag<B> (with the two specializations CGAL::Tag_true/CGAL::Tag_false),
  • std::boolean_constant<B> (with the two specializations std::true_type/std::false_type),
  • any specialization of a (UnaryTypeTrait)[https://en.cppreference.com/w/cpp/named_req/UnaryTypeTrait.html] std::is_*something*<T> from <type_traits>

What do you think of that addition? Should we document it?

If it were me, Sequential_tag and Parallel_tag would have been enumerators, instead of tag types, but we have to deal with what was chosen at the time (even at the time of CGAL 4.3, when the base C++ standard for CGAL was C++03, enums were allowed as non-type template parameters).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions