kblib 0.2.3
General utilities library for modern C++
kblib::delayed_construct< T > Class Template Reference

#include <kblib/delayed_construct.h>

Public Member Functions

template<typename... Ts>
 delayed_construct (Ts &&... args)
 
template<typename U , std::enable_if_t< std::is_assignable_v< T &, U && >, int > = 0>
auto operator= (U &&t) -> delayed_construct &
 
auto operator= (std::nullopt_t) -> delayed_construct &=delete
 
template<typename... Ts>
auto emplace (Ts &&... args) const -> decltype(auto)
 
 delayed_construct (const delayed_construct &)=default
 
 delayed_construct (delayed_construct &&)=default
 
auto operator= (const delayed_construct &) -> delayed_construct &=default
 
auto operator= (delayed_construct &&) -> delayed_construct &=default
 
 ~delayed_construct ()=default
 
auto operator-> () const -> decltype(auto)
 
auto operator* () const -> decltype(auto)
 
auto value () const -> decltype(auto)
 
 operator bool () const
 
constexpr auto is_constructed () const noexcept -> bool
 

Protected Attributes

Base storage
 

Friends

struct std::hash< delayed_construct< T > >
 
struct FNV_hash< delayed_construct< T > >
 
Equality

Two delayed_construct<T> objects are equal if either neither contains a value, or if both contain the same value. std::nullopt_t is equivalent to a non-constructed object, and a value is equivalent to a constructed one.

constexpr auto operator== (const delayed_construct &lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator== (const delayed_construct &lhs, const delayed_construct< U > &rhs) noexcept -> bool
 
constexpr auto operator== (const delayed_construct &lhs, std::nullopt_t rhs) noexcept -> bool
 
constexpr auto operator== (std::nullopt_t lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator== (const delayed_construct &opt, const U &value) noexcept -> bool
 
template<typename U >
constexpr auto operator== (const U &value, const delayed_construct &opt) noexcept -> bool
 
constexpr auto operator!= (const delayed_construct &lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator!= (const delayed_construct &lhs, const delayed_construct< U > &rhs) noexcept -> bool
 
constexpr auto operator!= (const delayed_construct &lhs, std::nullopt_t rhs) noexcept -> bool
 
constexpr auto operator!= (std::nullopt_t lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator!= (const delayed_construct &opt, const U &value) noexcept -> bool
 
template<typename U >
constexpr auto operator!= (const U &value, const delayed_construct &opt) noexcept -> bool
 
Comparison

A non-constructed delayed_construct<T> object is less than any constructed one. std::nullopt_t is equivalent to a non-constructed object, and a value is equivalent to a constructed one.

constexpr auto operator< (const delayed_construct &lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator< (const delayed_construct &lhs, const delayed_construct< U > &rhs) noexcept -> bool
 
constexpr auto operator< (const delayed_construct &lhs, std::nullopt_t rhs) noexcept -> bool
 
constexpr auto operator< (std::nullopt_t lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator< (const delayed_construct &opt, const U &value) noexcept -> bool
 
template<typename U >
constexpr auto operator< (const U &value, const delayed_construct &opt) noexcept -> bool
 
constexpr auto operator<= (const delayed_construct &lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator<= (const delayed_construct &lhs, const delayed_construct< U > &rhs) noexcept -> bool
 
constexpr auto operator<= (const delayed_construct &lhs, std::nullopt_t rhs) noexcept -> bool
 
constexpr auto operator<= (std::nullopt_t lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator<= (const delayed_construct &opt, const U &value) noexcept -> bool
 
template<typename U >
constexpr auto operator<= (const U &value, const delayed_construct &opt) noexcept -> bool
 
constexpr auto operator> (const delayed_construct &lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator> (const delayed_construct &lhs, const delayed_construct< U > &rhs) noexcept -> bool
 
constexpr auto operator> (const delayed_construct &lhs, std::nullopt_t rhs) noexcept -> bool
 
constexpr auto operator> (std::nullopt_t lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator> (const delayed_construct &opt, const U &value) noexcept -> bool
 
template<typename U >
constexpr auto operator> (const U &value, const delayed_construct &opt) noexcept -> bool
 
constexpr auto operator>= (const delayed_construct &lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator>= (const delayed_construct &lhs, const delayed_construct< U > &rhs) noexcept -> bool
 
constexpr auto operator>= (const delayed_construct &lhs, std::nullopt_t rhs) noexcept -> bool
 
constexpr auto operator>= (std::nullopt_t lhs, const delayed_construct &rhs) noexcept -> bool
 
template<typename U >
constexpr auto operator>= (const delayed_construct &opt, const U &value) noexcept -> bool
 
template<typename U >
constexpr auto operator>= (const U &value, const delayed_construct &opt) noexcept -> bool
 

Detailed Description

template<typename T>
class kblib::delayed_construct< T >

Definition at line 51 of file delayed_construct.h.

Constructor & Destructor Documentation

◆ delayed_construct() [1/3]

template<typename T >
template<typename... Ts>
kblib::delayed_construct< T >::delayed_construct ( Ts &&...  args)
inline

Definition at line 61 of file delayed_construct.h.

◆ delayed_construct() [2/3]

template<typename T >
kblib::delayed_construct< T >::delayed_construct ( const delayed_construct< T > &  )
default

◆ delayed_construct() [3/3]

template<typename T >
kblib::delayed_construct< T >::delayed_construct ( delayed_construct< T > &&  )
default

◆ ~delayed_construct()

template<typename T >
kblib::delayed_construct< T >::~delayed_construct ( )
default

Member Function Documentation

◆ emplace()

template<typename T >
template<typename... Ts>
auto kblib::delayed_construct< T >::emplace ( Ts &&...  args) const -> decltype(auto)
inline

Definition at line 72 of file delayed_construct.h.

◆ is_constructed()

template<typename T >
constexpr auto kblib::delayed_construct< T >::is_constructed ( ) const -> bool
inlineconstexprnoexcept

Definition at line 86 of file delayed_construct.h.

◆ operator bool()

template<typename T >
kblib::delayed_construct< T >::operator bool ( ) const
inlineexplicit

Definition at line 85 of file delayed_construct.h.

◆ operator*()

template<typename T >
auto kblib::delayed_construct< T >::operator* ( ) const -> decltype(auto)
inline

Definition at line 83 of file delayed_construct.h.

◆ operator->()

template<typename T >
auto kblib::delayed_construct< T >::operator-> ( ) const -> decltype(auto)
inline

Definition at line 82 of file delayed_construct.h.

◆ operator=() [1/4]

template<typename T >
auto kblib::delayed_construct< T >::operator= ( const delayed_construct< T > &  ) -> delayed_construct &=default
default

◆ operator=() [2/4]

template<typename T >
auto kblib::delayed_construct< T >::operator= ( delayed_construct< T > &&  ) -> delayed_construct &=default
default

◆ operator=() [3/4]

template<typename T >
auto kblib::delayed_construct< T >::operator= ( std::nullopt_t  ) -> delayed_construct &=delete
delete

◆ operator=() [4/4]

template<typename T >
template<typename U , std::enable_if_t< std::is_assignable_v< T &, U && >, int > = 0>
auto kblib::delayed_construct< T >::operator= ( U &&  t) -> delayed_construct&
inline

Definition at line 65 of file delayed_construct.h.

◆ value()

template<typename T >
auto kblib::delayed_construct< T >::value ( ) const -> decltype(auto)
inline

Definition at line 84 of file delayed_construct.h.

Friends And Related Function Documentation

◆ FNV_hash< delayed_construct< T > >

template<typename T >
friend struct FNV_hash< delayed_construct< T > >
friend

Definition at line 166 of file delayed_construct.h.

◆ operator!= [1/6]

template<typename T >
constexpr auto operator!= ( const delayed_construct< T > &  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 153 of file delayed_construct.h.

◆ operator!= [2/6]

template<typename T >
template<typename U >
constexpr auto operator!= ( const delayed_construct< T > &  lhs,
const delayed_construct< U > &  rhs 
) -> bool
friend

Definition at line 153 of file delayed_construct.h.

◆ operator!= [3/6]

template<typename T >
constexpr auto operator!= ( const delayed_construct< T > &  lhs,
std::nullopt_t  rhs 
) -> bool
friend

Definition at line 153 of file delayed_construct.h.

◆ operator!= [4/6]

template<typename T >
template<typename U >
constexpr auto operator!= ( const delayed_construct< T > &  opt,
const U &  value 
) -> bool
friend

Definition at line 153 of file delayed_construct.h.

◆ operator!= [5/6]

template<typename T >
template<typename U >
constexpr auto operator!= ( const U &  value,
const delayed_construct< T > &  opt 
) -> bool
friend

Definition at line 153 of file delayed_construct.h.

◆ operator!= [6/6]

template<typename T >
constexpr auto operator!= ( std::nullopt_t  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 153 of file delayed_construct.h.

◆ operator< [1/6]

template<typename T >
constexpr auto operator< ( const delayed_construct< T > &  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 163 of file delayed_construct.h.

◆ operator< [2/6]

template<typename T >
template<typename U >
constexpr auto operator< ( const delayed_construct< T > &  lhs,
const delayed_construct< U > &  rhs 
) -> bool
friend

Definition at line 163 of file delayed_construct.h.

◆ operator< [3/6]

template<typename T >
constexpr auto operator< ( const delayed_construct< T > &  lhs,
std::nullopt_t  rhs 
) -> bool
friend

Definition at line 163 of file delayed_construct.h.

◆ operator< [4/6]

template<typename T >
template<typename U >
constexpr auto operator< ( const delayed_construct< T > &  opt,
const U &  value 
) -> bool
friend

Definition at line 163 of file delayed_construct.h.

◆ operator< [5/6]

template<typename T >
template<typename U >
constexpr auto operator< ( const U &  value,
const delayed_construct< T > &  opt 
) -> bool
friend

Definition at line 163 of file delayed_construct.h.

◆ operator< [6/6]

template<typename T >
constexpr auto operator< ( std::nullopt_t  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 163 of file delayed_construct.h.

◆ operator<= [1/6]

template<typename T >
constexpr auto operator<= ( const delayed_construct< T > &  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 164 of file delayed_construct.h.

◆ operator<= [2/6]

template<typename T >
template<typename U >
constexpr auto operator<= ( const delayed_construct< T > &  lhs,
const delayed_construct< U > &  rhs 
) -> bool
friend

Definition at line 164 of file delayed_construct.h.

◆ operator<= [3/6]

template<typename T >
constexpr auto operator<= ( const delayed_construct< T > &  lhs,
std::nullopt_t  rhs 
) -> bool
friend

Definition at line 164 of file delayed_construct.h.

◆ operator<= [4/6]

template<typename T >
template<typename U >
constexpr auto operator<= ( const delayed_construct< T > &  opt,
const U &  value 
) -> bool
friend

Definition at line 164 of file delayed_construct.h.

◆ operator<= [5/6]

template<typename T >
template<typename U >
constexpr auto operator<= ( const U &  value,
const delayed_construct< T > &  opt 
) -> bool
friend

Definition at line 164 of file delayed_construct.h.

◆ operator<= [6/6]

template<typename T >
constexpr auto operator<= ( std::nullopt_t  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 164 of file delayed_construct.h.

◆ operator== [1/6]

template<typename T >
constexpr auto operator== ( const delayed_construct< T > &  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 152 of file delayed_construct.h.

◆ operator== [2/6]

template<typename T >
template<typename U >
constexpr auto operator== ( const delayed_construct< T > &  lhs,
const delayed_construct< U > &  rhs 
) -> bool
friend

Definition at line 152 of file delayed_construct.h.

◆ operator== [3/6]

template<typename T >
constexpr auto operator== ( const delayed_construct< T > &  lhs,
std::nullopt_t  rhs 
) -> bool
friend

Definition at line 152 of file delayed_construct.h.

◆ operator== [4/6]

template<typename T >
template<typename U >
constexpr auto operator== ( const delayed_construct< T > &  opt,
const U &  value 
) -> bool
friend

Definition at line 152 of file delayed_construct.h.

◆ operator== [5/6]

template<typename T >
template<typename U >
constexpr auto operator== ( const U &  value,
const delayed_construct< T > &  opt 
) -> bool
friend

Definition at line 152 of file delayed_construct.h.

◆ operator== [6/6]

template<typename T >
constexpr auto operator== ( std::nullopt_t  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 152 of file delayed_construct.h.

◆ operator> [1/6]

template<typename T >
constexpr auto operator> ( const delayed_construct< T > &  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 165 of file delayed_construct.h.

◆ operator> [2/6]

template<typename T >
template<typename U >
constexpr auto operator> ( const delayed_construct< T > &  lhs,
const delayed_construct< U > &  rhs 
) -> bool
friend

Definition at line 165 of file delayed_construct.h.

◆ operator> [3/6]

template<typename T >
constexpr auto operator> ( const delayed_construct< T > &  lhs,
std::nullopt_t  rhs 
) -> bool
friend

Definition at line 165 of file delayed_construct.h.

◆ operator> [4/6]

template<typename T >
template<typename U >
constexpr auto operator> ( const delayed_construct< T > &  opt,
const U &  value 
) -> bool
friend

Definition at line 165 of file delayed_construct.h.

◆ operator> [5/6]

template<typename T >
template<typename U >
constexpr auto operator> ( const U &  value,
const delayed_construct< T > &  opt 
) -> bool
friend

Definition at line 165 of file delayed_construct.h.

◆ operator> [6/6]

template<typename T >
constexpr auto operator> ( std::nullopt_t  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 165 of file delayed_construct.h.

◆ operator>= [1/6]

template<typename T >
constexpr auto operator>= ( const delayed_construct< T > &  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 166 of file delayed_construct.h.

◆ operator>= [2/6]

template<typename T >
template<typename U >
constexpr auto operator>= ( const delayed_construct< T > &  lhs,
const delayed_construct< U > &  rhs 
) -> bool
friend

Definition at line 166 of file delayed_construct.h.

◆ operator>= [3/6]

template<typename T >
constexpr auto operator>= ( const delayed_construct< T > &  lhs,
std::nullopt_t  rhs 
) -> bool
friend

Definition at line 166 of file delayed_construct.h.

◆ operator>= [4/6]

template<typename T >
template<typename U >
constexpr auto operator>= ( const delayed_construct< T > &  opt,
const U &  value 
) -> bool
friend

Definition at line 166 of file delayed_construct.h.

◆ operator>= [5/6]

template<typename T >
template<typename U >
constexpr auto operator>= ( const U &  value,
const delayed_construct< T > &  opt 
) -> bool
friend

Definition at line 166 of file delayed_construct.h.

◆ operator>= [6/6]

template<typename T >
constexpr auto operator>= ( std::nullopt_t  lhs,
const delayed_construct< T > &  rhs 
) -> bool
friend

Definition at line 166 of file delayed_construct.h.

◆ std::hash< delayed_construct< T > >

template<typename T >
friend struct std::hash< delayed_construct< T > >
friend

Definition at line 166 of file delayed_construct.h.

Member Data Documentation

◆ storage

template<typename T >
Base kblib::delayed_construct< T >::storage
protected

Definition at line 56 of file delayed_construct.h.


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