Title
Standard execution policy types should be conventional tag class types
Status
new
Section
[execpol]
Submitter
Jiang An

Created on 2025-06-03.00:00:00 last changed 3 weeks ago

Messages

Date: 2025-06-10.15:45:47

Proposed resolution:

This wording is relative to N5008.

  1. Modify [execpol.seq] as indicated:

    class execution::sequenced_policy { unspecified
    public:
      explicit sequenced_policy() = default; 
    };
    
  2. Modify [execpol.par] as indicated:

    class execution::parallel_policy { unspecified
    public:
      explicit parallel_policy() = default; 
    };
    
  3. Modify [execpol.parunseq] as indicated:

    class execution::parallel_unsequenced_policy { unspecified
    public:
      explicit parallel_unsequenced_policy() = default; 
    };
    
  4. Modify [execpol.unseq] as indicated:

    class execution::unsequenced_policy { unspecified
    public:
      explicit unsequenced_policy() = default; 
    };
    
  5. Modify [execpol.objects] as indicated:

    inline constexpr execution::sequenced_policy execution::seq{ unspecified };
    inline constexpr execution::parallel_policy execution::par{ unspecified };
    inline constexpr execution::parallel_unsequenced_policy execution::par_unseq{ unspecified };
    inline constexpr execution::unsequenced_policy execution::unseq{ unspecified };
    
Date: 2025-06-03.00:00:00

Existing standard execution policy types don't hold any state, and mostly act as disambiguating tags in parallel algorithms. Perhaps it will be better to ensure them to be similar to construction tag types, which possibly enables more desired usages.

Currently, libc++ makes these types non-movable, which is arguable undesired per the decision made in P3136R1.

History
Date User Action Args
2025-06-06 17:34:49adminsetmessages: + msg14781
2025-06-03 00:00:00admincreate