---
name: "std::__basic_future"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::__basic_future"
---

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

Common implementation for future and shared\_future.

## NAME

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

## SYNOPSIS

\#include \<future\>

Inherited by **std::future\< \_Res & \>**, **std::shared\_future\< \_Res & \>**, **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.

Referenced by **std::future\< \_Res \>::get()**, and **std::shared\_future\< \_Res \>::get()**.

## Author

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