Live Cells C++
Reactive Programming for C++
Loading...
Searching...
No Matches
live_cells::key_ref Class Reference

Dynamically type key container. More...

#include <keys.hpp>

Public Member Functions

const keyoperator* () const
 
const keyoperator-> () const
 

Static Public Member Functions

template<typename T , typename... Args>
static key_ref create (Args... args)
 Create a key_ref holding a key of type T.
 

Detailed Description

Dynamically type key container.

This container holds a key, while preserving its runtime type.

Copying this class only copies the reference, not the underlying object, which is kept in memory until the last key_ref pointing to it is destroyed.

Member Function Documentation

◆ create()

template<typename T , typename... Args>
static key_ref live_cells::key_ref::create ( Args... args)
inlinestatic

Create a key_ref holding a key of type T.

A new T is constructed in place with arguments args passed to the constructor.

Parameters
argsArguments to pass to constructor of T.

◆ operator*()

const key & live_cells::key_ref::operator* ( ) const
inline

Get a reference to the underlying key.

Returns
Reference to underlying key.

◆ operator->()

const key * live_cells::key_ref::operator-> ( ) const
inline

Access a member of the underlying key.

Returns
Pointer to underlying key.

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