Lumiera  0.pre.03
»edit your freedom«
RecordRef< VAL > Class Template Reference

#include "lib/diff/record.hpp"

Description

template<typename VAL>
class lib::diff::RecordRef< VAL >

wrapped record reference.

A helper for lib::GenNode and the diff representation. RecordRef is copyable and movable, but like a reference can not be rebound. It can be used to refer to a subtree within the diff representation, without the need to copy.

Remarks
this is almost identical to std::ref, with the notable difference that it can be default-created into "bottom" state; this also implies to have a NULL check on dereferentiation.

Definition at line 620 of file record.hpp.

Public Member Functions

 RecordRef () noexcept
 by default create an invalid ("bottom") reference
 
 RecordRef (Target &o) noexcept
 create a reference bound to the given target; can not be rebound
 
 RecordRef (Target &&)=delete
 prevent moving into black hole
 
 RecordRef (RecordRef const &)=default
 
 RecordRef (RecordRef &&)=default
 
bool empty () const
 
Targetget () const noexcept
 
 operator bool () const
 
 operator string () const
 
 operator Target & () const
 target is accessed by cast More...
 
RecordRefoperator= (RecordRef const &)=delete
 references can not be reassigned
 
RecordRefoperator= (RecordRef &)=delete
 
RecordRefoperator= (RecordRef &&o)
 assignment is not allowed, but moving is
 

Friends

bool operator!= (RecordRef const &r1, RecordRef const &r2)
 
bool operator== (RecordRef const &r1, RecordRef const &r2)
 

Private Types

using Target = Record< VAL >
 

Private Attributes

Targetrecord_
 

Member Function Documentation

◆ operator Target &()

operator Target & ( ) const
inline

target is accessed by cast

Exceptions
error::Logicon bottom reference

Definition at line 673 of file record.hpp.

Friends And Related Function Documentation

◆ operator==

bool operator== ( RecordRef< VAL > const &  r1,
RecordRef< VAL > const &  r2 
)
friend
Note
equality of references (instance pointers), not targets

Definition at line 695 of file record.hpp.

+ Collaboration diagram for RecordRef< VAL >:

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