Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::experi...hared_future(3) C++ Standard Libarystd::experi...hared_future(3)

NAME
       std::experimental::shared_future::shared_future	  -    std::experimen-
       tal::shared_future::shared_future

Synopsis
	  shared_future()					     noexcept;
       (1)
	  shared_future(std::experimental::shared_future<T>&&	f)   noexcept;
       (2)
	  shared_future(const	  std::experimental::shared_future<T>&	   f);
       (3)
	  shared_future(std::experimental::future<std::experimen-
       tal::shared_future<T>> && (4)
	  other) noexcept;
	  shared_future(std::experimental::future<T>&&	     f)	     noexcept;
       (5)

	  1) Default constructor. Constructs  an  empty	 shared_future	object
       that does not refer
	  to a shared state.
	  2)  Constructs a shared_future object, transferring the shared state
       held by f, if
	  any. After construction, f.valid() is	false.
	  3) Constructs	a shared future	that refers to the same	 shared	 state
       as f, if	any.
	  4)  Unwrapping  constructor.	Constructs a shared_future object from
       the shared state
	  referred to by other,	if any.	If other.valid()  ==  false  prior  to
       this call, the
	  constructed  shared_future object is empty. Otherwise, the resulting
       shared_future
	  object becomes ready when one	of the following happens:

	    * other and	other.get() are	both ready.  The  value	 or  exception
       from other.get()	is
	      stored  in  the  shared  state  associated  with	the  resulting
       shared_future object.
	    * other is ready, but other.get() is invalid. An exception of type
	      std::future_error	 with	an   error   condition	 of   std::fu-
       ture_errc::broken_promise is
	      stored  in  the  shared  state  associated  with	the  resulting
       shared_future object.

	  After	this constructor returns, valid() is equal  to	the  value  of
       other.valid() prior
	  to this call,	and other.valid() == false.
	  5)  Constructs a shared_future object, transferring the shared state
       held by f, if
	  any. After construction, f.valid() is	false.

Parameters
	  f	- another future object	to initialize with
	  other	- A std::experimental::future object to	unwrap

Example
	   This	section	is incomplete
	   Reason: no example

	 Defect	reports

	  The following	behavior-changing defect reports were applied retroac-
       tively to
	  previously published C++ standards.

	     DR	       Applied	  to		   Behavior    as    published
       Correct behavior
	  LWG  2697  Concurrency  TS  behavior	of  unwrapping	constructor is
       constructs an empty
				  unclear with an invalid future	   fu-
       ture

See also
	  constructor	constructs the future object
			(public	member function	of std::shared_future<T>)

http://cppreference.com		  2022.07.31	 std::experi...hared_future(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::experimental::shared_future::shared_future&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help