stlab 2.3.0
Modern, modular C++ algorithms, data structures, and concurrency primitives
Loading...
Searching...
No Matches
stlab::task_< NoExcept, R, Args > Class Template Reference

Type-erased, move-only callable with signature R(Args...) (or noexcept variant). More...

#include <task.hpp>

Public Types

using result_type

Public Member Functions

constexpr task_ (std::nullptr_t) noexcept
 task_ (const task_ &)=delete
 task_ (const task_ &&)=delete
 task_ (task_ &&x) noexcept
template<class F, std::enable_if_t<!NoExcept||std::is_nothrow_invocable_v< F, Args... >, bool > = true>
 task_ (F &&f)
auto operator= (const task_ &) -> task_ &=delete
auto operator= (task_ &&x) noexcept -> task_ &
auto operator= (std::nullptr_t) noexcept -> task_ &
template<class F>
auto operator= (F &&f) -> std::enable_if_t<!NoExcept||std::is_nothrow_invocable_v< decltype(f), Args... >, task_ & >
void swap (task_ &x) noexcept
 operator bool () const
auto target_type () const noexcept -> const std::type_info &
template<class T>
auto target () -> T *
template<class T>
auto target () const -> const T *
template<class... Brgs>
auto operator() (Brgs &&... brgs) noexcept(NoExcept)

Detailed Description

template<bool NoExcept, class R, class... Args>
class stlab::task_< NoExcept, R, Args >

Type-erased, move-only callable with signature R(Args...) (or noexcept variant).

Mutable operator() supports moving arguments through for single invocations. Compare to nullptr when empty; use target() / target_type() for runtime type queries.


The documentation for this class was generated from the following file: