MCPcopy Create free account
hub / github.com/NVIDIA/stdexec / value_category_receiver

Class value_category_receiver

test/exec/asio/test_completion_token.cpp:699–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697 }
698
699 struct value_category_receiver
700 {
701 using receiver_concept = receiver_tag;
702
703 void set_value(std::mutex&&) && noexcept
704 {
705 CHECK(kind_ == kind::none);
706 kind_ = kind::rvalue;
707 }
708
709 void set_value(std::mutex&) && noexcept
710 {
711 CHECK(kind_ == kind::none);
712 kind_ = kind::mutable_lvalue;
713 }
714
715 void set_value(std::mutex const &) && noexcept
716 {
717 CHECK(kind_ == kind::none);
718 kind_ = kind::const_lvalue;
719 }
720
721 void set_error(std::exception_ptr) && noexcept
722 {
723 CHECK(kind_ == kind::none);
724 kind_ = kind::error;
725 }
726
727 void set_stopped() && noexcept
728 {
729 CHECK(kind_ == kind::none);
730 kind_ = kind::stopped;
731 }
732 enum class kind
733 {
734 none,
735 rvalue,
736 mutable_lvalue,
737 const_lvalue,
738 error,
739 stopped
740 };
741
742 constexpr explicit value_category_receiver(kind& k) noexcept
743 : kind_(k)
744 {}
745 private:
746 kind& kind_;
747 };
748
749 TEST_CASE("When the operation declares separate rvalue and lvalue completion signatures they are "
750 "appropriately passed through",

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected