---
name: "std::__basic_future"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::__basic_future/3cxx"
---

# std::\_\_basic\_future(3cxx)

Common implementation for future and shared\_future.

## NAME

std::\_\_basic\_future\< \_Res \> - Common implementation for future and shared\_future.

## SYNOPSIS

`#include <future>`

Inherits \_\_future\_base.

Inherited by **std::future\< \_Res \>**, and **std::shared\_future\< \_Res \>**.

### Public Member Functions

**\_\_basic\_future** (const **\_\_basic\_future** &)=**delete**\
 **\_\_basic\_future** & **operator=** (const **\_\_basic\_future** &)=**delete**\
 bool **valid** () const noexcept\
 **void** **wait** () const\
 template\<**typename** \_Rep , **typename** **\_Period** \> **future\_status** **wait\_for** (const **chrono::duration**\< \_Rep, **\_Period** \> &**\_\_rel**) const\
 template\<**typename** **\_Clock** , **typename** **\_Duration** \> **future\_status** **wait\_until** (const **chrono::time\_point**\< **\_Clock**, **\_Duration** \> &**\_\_abs**) const\

### Protected Types

**typedef** \_\_future\_base::\_Result\< **\_Res** \> & **\_\_result\_type**\
 **typedef** **shared\_ptr**\< \_State\_base \> **\_\_state\_type**\

### Protected Member Functions

**\_\_basic\_future** (const **\_\_state\_type** &**\_\_state**)\
 **\_\_basic\_future** (const **shared\_future**\< **\_Res** \> &) noexcept\
 **\_\_basic\_future** (**future**\< **\_Res** \> &&) noexcept\
 **\_\_basic\_future** (**shared\_future**\< **\_Res** \> &&) noexcept\
 \_\_result\_type **\_M\_get\_result** () const\
 Wait for the state to be ready and rethrow any stored exception.  **void** **\_M\_swap** (**\_\_basic\_future** &**\_\_that**) noexcept\

## Detailed Description

### template\<typename \_Res\>

class std::\_\_basic\_future\< \_Res \>"Common implementation for future and shared\_future.

## Member Function Documentation

### template\<typename \_Res \> \_\_result\_type std::\_\_basic\_future\< \_Res \>::\_M\_get\_result () const` [inline]`, ` [protected]`

Wait for the state to be ready and rethrow any stored exception.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
