Title
`sch_` must not be in moved-from state
Status
wp
Section
[exec.task.scheduler]
Submitter
Tomasz Kamiński

Created on 2025-11-05.00:00:00 last changed 1 week ago

Messages

Date: 2025-11-11.10:48:55

Proposed resolution:

This wording is relative to N5014.

  1. Modify [exec.task.scheduler] as indicated:

    namespace std::execution {
      class task_scheduler {
        class ts-sender;                    // exposition only
    
        template<receiver R>
          class state;                      // exposition only
    
      public:
        using scheduler_concept = scheduler_t;
    
        template<class Sch, class Allocator = allocator<void>>
          requires (!same_as<task_scheduler, remove_cvref_t<Sch>>)
            && scheduler<Sch>
        explicit task_scheduler(Sch&& sch, Allocator alloc = {});
    
        task_scheduler(const task_scheduler&) = default;
        task_scheduler& operator=(const task_scheduler&) = default;
    
        ts-sender schedule();
    
        friend bool operator==(const task_scheduler& lhs, const task_scheduler& rhs)
            noexcept;
        template<class Sch>
          requires (!same_as<task_scheduler, Sch>)
          && scheduler<Sch>
        friend bool operator==(const task_scheduler& lhs, const Sch& rhs) noexcept;
    
      private:
        shared_ptr<void> sch_; // exposition only
      };
    }
    
Date: 2025-11-11.10:48:55

[ Kona 2025-11-08; Status changed: Immediate → WP. ]

Date: 2025-11-05.19:41:13

[ Kona 2025-11-05; approved by LWG. Status changed: New → Immediate. ]

Date: 2025-11-05.00:00:00
Addresses US 239-367

As specified, there is an implicit precondition that `sch_` is not moved from on all the member functions. If that is intended, the precondition should be made explicit.

History
Date User Action Args
2025-11-11 10:48:55adminsetmessages: + msg15698
2025-11-11 10:48:55adminsetstatus: immediate -> wp
2025-11-05 19:41:13adminsetmessages: + msg15527
2025-11-05 19:41:13adminsetstatus: new -> immediate
2025-11-05 16:28:45adminsetmessages: + msg15512
2025-11-05 00:00:00admincreate