Namespaces
Variants
Views
Actions

std::future::valid

From cppreference.com
< cpp‎ | thread‎ | future
Revision as of 20:01, 2 November 2012 by P12bot (Talk | contribs)

bool valid() const;
(since C++11)

Checks if the future refers to a shared state. This is the case only for futures returned by std::promise::get_future(), std::packaged_task::get_future() or std::async() until the first time get()or share() is called.

Contents

Parameters

(none)

Return value

true if *this refers to a shared state, otherwise false.

Exceptions

noexcept specification:  
noexcept
  

Example

See also

waits for the result to become available
(public member function) [edit]