std::experimental::future<T>::future (3) - Linux Manuals
std::experimental::future<T>::future: std::experimental::future<T>::future
Command to display std::experimental::future<T>::future
manual in Linux: $ man 3 std::experimental::future<T>::future
NAME
std::experimental::future<T>::future - std::experimental::future<T>::future
Synopsis
future() noexcept; (1)
future(std::experimental::future<T>&& f) noexcept; (2)
future(const std::experimental::future<T>&) = delete; (3)
future(std::experimental::future<std::experimental::future<T>> && other) noexcept; (4)
1) Default constructor. Constructs an empty future object that does not refer to a shared state.
2) Constructs a future object, transferring the shared state held by f, if any. After construction, f.valid() is false.
3) Copy constructor is deleted. future cannot be copied.
4) Unwrapping constructor. Constructs a future object from the shared state referred to by other, if any. If other.valid() == false prior to this call, the constructed future object is empty. Otherwise, the resulting 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 future object.
* other is ready, but other.get() is invalid. An exception of type std::future_error with an error condition of std::future_errc::broken_promise is stored in the shared state associated with the resulting future object.
After this constructor returns, valid() is equal to the value of other.valid() prior to this call, and other.valid() == 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 retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior
LWG_2697 Concurrency TS behavior of unwrapping constructor is unclear with an invalid future constructs an empty future
See also
constructs the future object
constructor (public member function of std::future<T>)
Pages related to std::experimental::future<T>::future
- std::experimental::future<T>::is_ready (3) - std::experimental::future<T>::is_ready
- std::experimental::future<T>::operator= (3) - std::experimental::future<T>::operator=
- std::experimental::future<T>::then (3) - std::experimental::future<T>::then
- std::experimental::future (3) - std::experimental::future
- std::experimental::function (3) - std::experimental::function
- std::experimental::function<R(Args...)>::function (3) - std::experimental::function<R(Args...)>::function
- std::experimental::function<R(Args...)>::get_memory_resource (3) - std::experimental::function<R(Args...)>::get_memory_resource
- std::experimental::function<R(Args...)>::operator= (3) - std::experimental::function<R(Args...)>::operator=
- std::experimental::function<R(Args...)>::swap (3) - std::experimental::function<R(Args...)>::swap
- std::experimental::filesystem::absolute,std::experimental::filesystem::system_complete (3) - std::experimental::filesystem::absolute,std::experimental::filesystem::system_complete
- std::experimental::filesystem::begin(directory_iterator), (3) - std::experimental::filesystem::begin(directory_iterator),
- std::experimental::filesystem::begin(directory_iterator),std::experimental::filesystem::end(directory_iterator) (3) - std::experimental::filesystem::begin(directory_iterator),std::experimental::filesystem::end(directory_iterator)
- std::experimental::filesystem::begin(recursive_directory_iterator), (3) - std::experimental::filesystem::begin(recursive_directory_iterator),
- std::experimental::filesystem::begin(recursive_directory_iterator),std::experimental::filesystem::end(recursive_directory_iterator) (3) - std::experimental::filesystem::begin(recursive_directory_iterator),std::experimental::filesystem::end(recursive_directory_iterator)
- std::experimental::filesystem::canonical (3) - std::experimental::filesystem::canonical
- std::experimental::filesystem::copy (3) - std::experimental::filesystem::copy
- std::experimental::filesystem::copy_file (3) - std::experimental::filesystem::copy_file
- std::experimental::filesystem::copy_options (3) - std::experimental::filesystem::copy_options
- std::experimental::filesystem::copy_symlink (3) - std::experimental::filesystem::copy_symlink
- std::experimental::filesystem::create_directory, (3) - std::experimental::filesystem::create_directory,
- std::experimental::filesystem::create_directory,std::experimental::filesystem::create_directories (3) - std::experimental::filesystem::create_directory,std::experimental::filesystem::create_directories
- std::experimental::filesystem::create_hard_link (3) - std::experimental::filesystem::create_hard_link
- std::experimental::filesystem::create_symlink, (3) - std::experimental::filesystem::create_symlink,
- std::experimental::filesystem::create_symlink,std::experimental::filesystem::create_directory_symlink (3) - std::experimental::filesystem::create_symlink,std::experimental::filesystem::create_directory_symlink