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

FreeBSD Manual Pages

  
 
  

home | help
std::future::share(3)	      C++ Standard Libary	 std::future::share(3)

NAME
       std::future::share - std::future::share

Synopsis
	  std::shared_future<T>	share()	noexcept;

	  Transfers the	shared state of	*this, if any, to a std::shared_future
       object.
	  Multiple  std::shared_future	objects	 may reference the same	shared
       state, which is
	  not possible with std::future.

	  After	calling	share on a std::future,	valid()	== false.

Parameters
	  (none)

Return value
	  A std::shared_future object containing the shared  state  previously
       held by *this, if
	  any, constructed as if by std::shared_future<T>(std::move(*this)).

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 2556 C++11      share() requires valid() to be  requirement  re-
       moved and made
			      true			     noexcept

See also
	  shared_future	 waits	for  a value (possibly referenced by other fu-
       tures) that is set
	  (C++11)	asynchronously
			(class template)

http://cppreference.com		  2022.07.31		 std::future::share(3)

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

home | help