Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::promise(library fundamentals TS)

      From cppreference.com
      <cpp‎ |experimental‎ |lib extensions
       
       
       
       
       

      This page is about the modified version ofstd::promise with type-erased allocator support provided by the Library Fundamentals TSes. For the version ofpromise provided by the concurrency TS supporting thestd::future improvements made by that TS, seestd::experimental::concurrency_v1::promise.

      Defined in header<experimental/future>
      template<class R>class promise;
      (1)(library fundamentals TS)
      template<class R>class promise<R&>;
      (2)(library fundamentals TS)
      template<>          class promise<void>;
      (3)(library fundamentals TS)

      std::experimental::fundamentals_v1::promise (andstd::experimental::fundamentals_v2::promise) is a modified version ofstd::promise provided by the library fundamentals TS with support for type-erased allocators.

      Contents

      [edit] Member types

      Member type Definition
      allocator_typestd::experimental::erased_type

      [edit] Member functions

      constructs the promise object
      (public member function)[edit]
      retrieves a pointer to the memory resource used by this object to allocate memory
      (public member function)[edit]

      [edit] Non-member function

      specializes theswap algorithm
      (function template)[edit]

      [edit]Helper classes

      specializes thestd::uses_allocator type trait
      (class template specialization)[edit]

      Members identical tostd::promise

      Member functions

      destructs the promise object
      (public member function ofstd::promise<R>)[edit]
      assigns the shared state
      (public member function ofstd::promise<R>)[edit]
      swaps two promise objects
      (public member function ofstd::promise<R>)[edit]
      Getting the result
      returns afuture associated with the promised result
      (public member function ofstd::promise<R>)[edit]
      Setting the result
      sets the result to specific value
      (public member function ofstd::promise<R>)[edit]
      sets the result to specific value while delivering the notification only at thread exit
      (public member function ofstd::promise<R>)[edit]
      sets the result to indicate an exception
      (public member function ofstd::promise<R>)[edit]
      sets the result to indicate an exception while delivering the notification only at thread exit
      (public member function ofstd::promise<R>)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/lib_extensions/promise&oldid=98608"

      [8]ページ先頭

      ©2009-2025 Movatter.jp