rangeless::fn
rangeless::fn::impl::maybe< T > Class Template Reference

Very bare-bones version of std::optional-like with rebinding assignment semantics. More...

#include <fn.hpp>

Public Types

using value_type = T
 

Public Member Functions

 maybe ()
 
 maybe (const maybe &)=delete
 
maybeoperator= (const maybe &)=delete
 
 maybe (T &&val)
 
 maybe (maybe &&other) noexcept
 
maybeoperator= (maybe &&other) noexcept
 
void reset (T &&val)
 
void reset ()
 
 operator bool () const noexcept
 
T & operator * () noexcept
 
const T & operator * () const noexcept
 
 ~maybe ()
 

Detailed Description

template<class T>
class rangeless::fn::impl::maybe< T >

Very bare-bones version of std::optional-like with rebinding assignment semantics.

Definition at line 78 of file fn.hpp.

Member Typedef Documentation

◆ value_type

template<class T>
using rangeless::fn::impl::maybe< T >::value_type = T

Definition at line 90 of file fn.hpp.

Constructor & Destructor Documentation

◆ maybe() [1/4]

template<class T>
rangeless::fn::impl::maybe< T >::maybe ( )
inline

Definition at line 94 of file fn.hpp.

◆ maybe() [2/4]

template<class T>
rangeless::fn::impl::maybe< T >::maybe ( const maybe< T > &  )
delete

◆ maybe() [3/4]

template<class T>
rangeless::fn::impl::maybe< T >::maybe ( T &&  val)
inline

Definition at line 101 of file fn.hpp.

◆ maybe() [4/4]

template<class T>
rangeless::fn::impl::maybe< T >::maybe ( maybe< T > &&  other)
inlinenoexcept

Definition at line 106 of file fn.hpp.

◆ ~maybe()

template<class T>
rangeless::fn::impl::maybe< T >::~maybe ( )
inline

Definition at line 241 of file fn.hpp.

Member Function Documentation

◆ operator *() [1/2]

template<class T>
T& rangeless::fn::impl::maybe< T >::operator * ( )
inlinenoexcept

Definition at line 193 of file fn.hpp.

◆ operator *() [2/2]

template<class T>
const T& rangeless::fn::impl::maybe< T >::operator * ( ) const
inlinenoexcept

Definition at line 217 of file fn.hpp.

◆ operator bool()

template<class T>
rangeless::fn::impl::maybe< T >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 188 of file fn.hpp.

◆ operator=() [1/2]

template<class T>
maybe& rangeless::fn::impl::maybe< T >::operator= ( const maybe< T > &  )
delete

◆ operator=() [2/2]

template<class T>
maybe& rangeless::fn::impl::maybe< T >::operator= ( maybe< T > &&  other)
inlinenoexcept

Definition at line 119 of file fn.hpp.

◆ reset() [1/2]

template<class T>
void rangeless::fn::impl::maybe< T >::reset ( T &&  val)
inline

Definition at line 132 of file fn.hpp.

◆ reset() [2/2]

template<class T>
void rangeless::fn::impl::maybe< T >::reset ( )
inline

Definition at line 180 of file fn.hpp.

Member Data Documentation

◆ m_sentinel

template<class T>
sentinel rangeless::fn::impl::maybe< T >::m_sentinel

Definition at line 83 of file fn.hpp.

◆ m_value

template<class T>
T rangeless::fn::impl::maybe< T >::m_value

Definition at line 84 of file fn.hpp.


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