header_utils
Loading...
Searching...
No Matches
ghassanpl::eval::value Struct Reference

Represents a single evaluated value; can store an rvalue (as json), an lvalue (json*), or a (const) reference (json const*); lvalues and refs are used purely in function arguments. More...

#include <eval.h>

Public Member Functions

 value (value const &) noexcept=default
 value (value &&) noexcept=default
value & operator= (value const &) noexcept=default
value & operator= (value &&) noexcept=default
template<typename... ARGS>
 explicit (false) value(ARGS &&... args) noexcept
 explicit (false) value(json &&j) noexcept
 explicit (false) value(json const *j) noexcept
 explicit (false) value(json *j) noexcept
bool is_lval () const noexcept
bool is_rval () const noexcept
bool is_ref () const noexcept
json & lval ()
void ref () &&=delete
json const & ref () const &
json const & forward () const &
json forward () &&
 explicit (false) operator json const &() const &
json const & operator* () const &
 explicit (false) operator json() &&
json operator* () &&
json const * operator-> () const &noexcept

Public Attributes

std::variant< json, json *, json const * > v

Detailed Description

Represents a single evaluated value; can store an rvalue (as json), an lvalue (json*), or a (const) reference (json const*); lvalues and refs are used purely in function arguments.

Notably, no garbage collection is performed, so take care around lifetimes of values and references.

Definition at line 43 of file eval.h.

Member Function Documentation

◆ explicit() [1/6]

ghassanpl::eval::value::explicit ( false ) const &
inlinenodiscard

Definition at line 96 of file eval.h.

◆ explicit() [2/6]

ghassanpl::eval::value::explicit ( false ) &&
inlinenodiscard

Definition at line 106 of file eval.h.

◆ explicit() [3/6]

template<typename... ARGS>
ghassanpl::eval::value::explicit ( false ) &&
inlinenoexcept

Definition at line 55 of file eval.h.

◆ explicit() [4/6]

ghassanpl::eval::value::explicit ( false ) &&
inlinenoexcept

Definition at line 57 of file eval.h.

◆ explicit() [5/6]

ghassanpl::eval::value::explicit ( false )
inlinenoexcept

Definition at line 59 of file eval.h.

◆ explicit() [6/6]

ghassanpl::eval::value::explicit ( false ) const
inlinenoexcept

Definition at line 58 of file eval.h.

◆ forward() [1/2]

json ghassanpl::eval::value::forward ( ) &&
inlinenodiscard

Definition at line 85 of file eval.h.

◆ forward() [2/2]

json const & ghassanpl::eval::value::forward ( ) const &
inlinenodiscard

Definition at line 80 of file eval.h.

◆ is_lval()

bool ghassanpl::eval::value::is_lval ( ) const
inlinenodiscardnoexcept

Definition at line 61 of file eval.h.

◆ is_ref()

bool ghassanpl::eval::value::is_ref ( ) const
inlinenodiscardnoexcept

Definition at line 63 of file eval.h.

◆ is_rval()

bool ghassanpl::eval::value::is_rval ( ) const
inlinenodiscardnoexcept

Definition at line 62 of file eval.h.

◆ lval()

json & ghassanpl::eval::value::lval ( )
inlinenodiscard

Definition at line 65 of file eval.h.

◆ operator*() [1/2]

json ghassanpl::eval::value::operator* ( ) &&
inlinenodiscard

Definition at line 111 of file eval.h.

◆ operator*() [2/2]

json const & ghassanpl::eval::value::operator* ( ) const &
inlinenodiscard

Definition at line 101 of file eval.h.

◆ operator->()

json const * ghassanpl::eval::value::operator-> ( ) const &
inlinenodiscardnoexcept

Definition at line 116 of file eval.h.

◆ ref()

json const & ghassanpl::eval::value::ref ( ) const &
inlinenodiscard

Definition at line 69 of file eval.h.

Member Data Documentation

◆ v

std::variant<json, json*, json const*> ghassanpl::eval::value::v

Definition at line 45 of file eval.h.