Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::never_stop_token

      From cppreference.com
      <cpp‎ |thread
       
       
      Concurrency support library
      Threads
      (C++11)
      (C++20)
      this_thread namespace
      (C++11)
      (C++11)
      (C++11)
      Cooperative cancellation
      (C++20)
      never_stop_token
      (C++26)
      Mutual exclusion
      Generic lock management
      (C++11)
      (C++11)
      (C++11)
      (C++11)
      Condition variables
      (C++11)
      Semaphores
      Latches and Barriers
      (C++20)
      (C++20)
      Futures
      (C++11)
      (C++11)
      (C++11)
      Safe reclamation
      Hazard pointers
      Atomic types
      (C++11)
      (C++20)
      Initialization of atomic types
      (C++11)(deprecated in C++20)
      (C++11)(deprecated in C++20)
      Memory ordering
      (C++11)(deprecated in C++26)
      Free functions for atomic operations
      Free functions for atomic flags
       
      Defined in header<stop_token>
      class never_stop_token;
      (since C++26)

      Thenever_stop_token class modelsunstoppable_token that provides static information that a stop is never possible nor requested. It is the default stop token type returned bystd::get_stop_token if no other associated stop token is being provided in the queryable object.

      Contents

      [edit]Member alias templates

      Type Definition
      callback_type<Callback>/*callback-type*/
      where the type is defined as:
      struct/*callback-type*/

      {
         explicit/*callback-type*/( never_stop_token,
                                     auto&&)noexcept{}

      };
      (exposition only*)

      [edit]Member functions

      stop_requested
      [static]
      indicates that a stop can never be requested
      (public static member function)
      stop_possible
      [static]
      indicates that a stop is not possible
      (public static member function)
      operator==
      compares twonever_stop_token objects
      (public member function)

      std::never_stop_token::stop_requested

      staticconstexprbool stop_requested()noexcept{returnfalse;}

      Always returnsfalse, indicating that a stop can never be requested.

      std::never_stop_token::stop_possible

      staticconstexprbool stop_possible()noexcept{returnfalse;}

      Always returnsfalse, indicating that a stop is not possible.

      std::never_stop_token::operator==

      bool operator==(const never_stop_token&)const=default;

      Twonever_stop_token objects always compare equal.

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/thread/never_stop_token&oldid=177569"

      [8]ページ先頭

      ©2009-2025 Movatter.jp