libcoro  1.0
Coroutine support library for C++20
Classes | Public Member Functions | List of all members
coro::any< reserved_space > Class Template Reference

Movable any replacement with small object optimization - uses coro::function. More...

#include <function.h>

+ Collaboration diagram for coro::any< reserved_space >:

Classes

struct  content
 Contains information about stored content. More...
 

Public Member Functions

template<hasnt_cast_operator< any > Arg>
 any (Arg &&arg)
 Construct any instance. More...
 
 any ()
 Construct empty. More...
 
const content get_info () const
 Retrieve information about the content. More...
 
content get_info ()
 Retrieve information about the content. More...
 
template<typename T >
const T * get_ptr () const noexcept
 Get as pointer. More...
 
template<typename T >
T * get_ptr () noexcept
 Get as pointer. More...
 
template<typename T >
const T & get () const
 Get as reference. More...
 
template<typename T >
T & get ()
 Get as reference. More...
 
bool empty () const noexcept
 Determines whether object is empty. More...
 
 operator bool () const noexcept
 Determines validity. More...
 
template<typename T >
bool contains () const noexcept
 Tests whether object contains given type. More...
 

Detailed Description

template<unsigned int reserved_space = 4*sizeof(void *)>
class coro::any< reserved_space >

Movable any replacement with small object optimization - uses coro::function.

Template Parameters
reserved_spacespecifies reserved space for small objects, default value is 4 pointers. Note that there is always 1 pointer reserved for type information

Definition at line 306 of file function.h.


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