StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::PairReference< First, Second, SecondReference > Class Template Referencefinal

Tuple-like proxy for an immutable first value and callback-backed second value. More...

#include <StormByte/safe/pair.hxx>

Collaboration diagram for StormByte::Safe::PairReference< First, Second, SecondReference >:

Public Types

using value_type = Pair<First, Second>
 Copied entry value type.

Public Member Functions

 PairReference (const First &firstValue, const Second &secondValue, SecondReference secondReference)
 Bind the proxy to copied values and a mutable second-value proxy.
 operator const value_type & () const
 Convert to a refreshed caller-module Safe pair snapshot.
 PairReference (const PairReference &other)=default
 Copy a pair-reference proxy.
 PairReference (PairReference &&other)=default
 Move a pair-reference proxy.

Public Attributes

const First first
 Immutable first value copy.
SecondReference second
 Callback-backed second value proxy.

Friends

template<std::size_t Index>
requires (Index == 0)
const First & get (const PairReference &reference) noexcept
 Access the first component for structured bindings.
template<std::size_t Index>
requires (Index == 1)
SecondReference & get (PairReference &reference) noexcept
 Access the second component for structured bindings.
template<std::size_t Index>
requires (Index == 0)
const First && get (PairReference &&reference) noexcept
 Move-access the first component of a temporary proxy.
template<std::size_t Index>
requires (Index == 1)
SecondReference get (PairReference &&reference) noexcept
 Move-access the second component of a temporary proxy.
template<std::size_t Index>
requires (Index == 0)
const First && get (const PairReference &&reference) noexcept
 Read the first component of a const temporary proxy.
template<std::size_t Index>
requires (Index == 1)
SecondReference get (const PairReference &&reference)
 Read the second component of a const temporary proxy.

Detailed Description

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
class StormByte::Safe::PairReference< First, Second, SecondReference >

Tuple-like proxy for an immutable first value and callback-backed second value.

Template Parameters
FirstFirst value type.
SecondSecond value type.
SecondReferenceMutable reference proxy for the second value.

Member Typedef Documentation

◆ value_type

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
using StormByte::Safe::PairReference< First, Second, SecondReference >::value_type = Pair<First, Second>

Copied entry value type.

Constructor & Destructor Documentation

◆ PairReference() [1/3]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
StormByte::Safe::PairReference< First, Second, SecondReference >::PairReference ( const First & firstValue,
const Second & secondValue,
SecondReference secondReference )

Bind the proxy to copied values and a mutable second-value proxy.

Parameters
firstValueFirst value copy.
secondValueInitial second value copy.
secondReferenceCallback-backed second-value proxy.

◆ PairReference() [2/3]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
StormByte::Safe::PairReference< First, Second, SecondReference >::PairReference ( const PairReference< First, Second, SecondReference > & other)
default

Copy a pair-reference proxy.

Parameters
otherSource proxy.

◆ PairReference() [3/3]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
StormByte::Safe::PairReference< First, Second, SecondReference >::PairReference ( PairReference< First, Second, SecondReference > && other)
default

Move a pair-reference proxy.

Parameters
otherSource proxy.

Member Function Documentation

◆ operator const value_type &()

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
StormByte::Safe::PairReference< First, Second, SecondReference >::operator const value_type & ( ) const

Convert to a refreshed caller-module Safe pair snapshot.

Returns
Pair snapshot.

◆ get [1/6]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
template<std::size_t Index>
requires (Index == 1)
SecondReference get ( const PairReference< First, Second, SecondReference > && reference)
friend

Read the second component of a const temporary proxy.

Template Parameters
IndexComponent index, which must be one.
Parameters
referencePair-reference proxy.
Returns
Mapped-value proxy copy.

◆ get [2/6]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
template<std::size_t Index>
requires (Index == 0)
const First && get ( const PairReference< First, Second, SecondReference > && reference)
friend

Read the first component of a const temporary proxy.

Template Parameters
IndexComponent index, which must be zero.
Parameters
referencePair-reference proxy.
Returns
Const rvalue reference to the first value.

◆ get [3/6]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
template<std::size_t Index>
requires (Index == 0)
const First & get ( const PairReference< First, Second, SecondReference > & reference)
friend

Access the first component for structured bindings.

Template Parameters
IndexComponent index, which must be zero.
Parameters
referencePair-reference proxy.
Returns
First component.

◆ get [4/6]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
template<std::size_t Index>
requires (Index == 1)
SecondReference get ( PairReference< First, Second, SecondReference > && reference)
friend

Move-access the second component of a temporary proxy.

Template Parameters
IndexComponent index, which must be one.
Parameters
referencePair-reference proxy.
Returns
Mapped-value proxy.

◆ get [5/6]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
template<std::size_t Index>
requires (Index == 0)
const First && get ( PairReference< First, Second, SecondReference > && reference)
friend

Move-access the first component of a temporary proxy.

Template Parameters
IndexComponent index, which must be zero.
Parameters
referencePair-reference proxy.
Returns
Rvalue reference to the immutable first value.

◆ get [6/6]

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
template<std::size_t Index>
requires (Index == 1)
SecondReference & get ( PairReference< First, Second, SecondReference > & reference)
friend

Access the second component for structured bindings.

Template Parameters
IndexComponent index, which must be one.
Parameters
referencePair-reference proxy.
Returns
Second-value proxy.

Member Data Documentation

◆ first

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
const First StormByte::Safe::PairReference< First, Second, SecondReference >::first

Immutable first value copy.

◆ second

template<Type::SafeValue First, Type::SafeValue Second, class SecondReference>
SecondReference StormByte::Safe::PairReference< First, Second, SecondReference >::second

Callback-backed second value proxy.


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