Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Kept_Initializer< F > Class Template Reference

An initializer that a random generator keeps: one given as a modifiable lvalue is used where it is, so that the caller sees what the generator does to it; a temporary, or a const lvalue, is moved or copied into the generator, so that it lives as long as the generator. More...

#include <random_graph.H>

Inheritance diagram for Aleph::Kept_Initializer< F >:
[legend]
Collaboration diagram for Aleph::Kept_Initializer< F >:
[legend]

Public Member Functions

 Kept_Initializer (F &x) noexcept
 Use x where it is.
 
 Kept_Initializer (const F &x)
 Keep a copy of x.
 
 Kept_Initializer (F &&x)
 Keep x, moved.
 
 Kept_Initializer (const Kept_Initializer &)=delete
 
Kept_Initializer & operator= (const Kept_Initializer &)=delete
 
F & get () const noexcept
 The initializer.
 

Private Attributes

std::optional< F > own
 
F * f
 

Detailed Description

template<class F>
class Aleph::Kept_Initializer< F >

An initializer that a random generator keeps: one given as a modifiable lvalue is used where it is, so that the caller sees what the generator does to it; a temporary, or a const lvalue, is moved or copied into the generator, so that it lives as long as the generator.

Template Parameters
FType of the initializer.

Definition at line 115 of file random_graph.H.

Constructor & Destructor Documentation

◆ Kept_Initializer() [1/4]

template<class F >
Aleph::Kept_Initializer< F >::Kept_Initializer ( F &  x)
inlinenoexcept

Use x where it is.

Definition at line 122 of file random_graph.H.

◆ Kept_Initializer() [2/4]

template<class F >
Aleph::Kept_Initializer< F >::Kept_Initializer ( const F &  x)
inline

Keep a copy of x.

Definition at line 125 of file random_graph.H.

◆ Kept_Initializer() [3/4]

template<class F >
Aleph::Kept_Initializer< F >::Kept_Initializer ( F &&  x)
inline

Keep x, moved.

Definition at line 128 of file random_graph.H.

◆ Kept_Initializer() [4/4]

template<class F >
Aleph::Kept_Initializer< F >::Kept_Initializer ( const Kept_Initializer< F > &  )
delete

Member Function Documentation

◆ get()

template<class F >
F & Aleph::Kept_Initializer< F >::get ( ) const
inlinenoexcept

The initializer.

Definition at line 134 of file random_graph.H.

References Aleph::Kept_Initializer< F >::f.

◆ operator=()

template<class F >
Kept_Initializer & Aleph::Kept_Initializer< F >::operator= ( const Kept_Initializer< F > &  )
delete

Member Data Documentation

◆ f

template<class F >
F* Aleph::Kept_Initializer< F >::f
private

Definition at line 118 of file random_graph.H.

Referenced by Aleph::Kept_Initializer< F >::get().

◆ own

template<class F >
std::optional<F> Aleph::Kept_Initializer< F >::own
private

Definition at line 117 of file random_graph.H.


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