public member function
<future>
std::future::future default (1)future() noexcept;copy [deleted] (2)
future (const future&) = delete;move (3)
future (future&& x) noexcept;
Construct future
Constructs a future object:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// future::future
#include <iostream> // std::cout
#include <future> // std::async, std::future
int get_value() { return 10; }
int main ()
{
std::future<int> foo; // default-constructed
std::future<int> bar = std::async (get_value); // move-constructed
int x = bar.get();
std::cout << "value: " << x << '\n';
return 0;
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4