libcopp  2.2.0
Public Types | Public Member Functions | Private Attributes
gsl::not_null< T > Class Template Reference

#include <not_null.h>

Inheritance diagram for gsl::not_null< T >:
Inheritance graph
Collaboration diagram for gsl::not_null< T >:
Collaboration graph

Public Types

using value_type = typename std::conditional< std::is_copy_constructible< T >::value, T, const T & >::type
 

Public Member Functions

template<class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
constexpr not_null (U &&u)
 
template<class = typename std::enable_if<!std::is_same<std::nullptr_t, T>::value>::type>
constexpr not_null (T u)
 
template<class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
constexpr not_null (const not_null< U > &other)
 
 not_null (const not_null &other)=default
 
not_nulloperator= (const not_null &other)=default
 
constexpr value_type get () const
 
constexpr operator T () const
 
constexpr value_type operator-> () const
 
constexpr std::remove_pointer< value_type >::type operator* () const
 
 not_null (std::nullptr_t)=delete
 
not_nulloperator= (std::nullptr_t)=delete
 
not_nulloperator++ ()=delete
 
not_nulloperator-- ()=delete
 
not_null operator++ (int)=delete
 
not_null operator-- (int)=delete
 
not_nulloperator+= (std::ptrdiff_t)=delete
 
not_nulloperator-= (std::ptrdiff_t)=delete
 
void operator[] (std::ptrdiff_t) const =delete
 

Private Attributes

ptr_
 

Detailed Description

template<class T>
class gsl::not_null< T >

Definition at line 66 of file not_null.h.

Member Typedef Documentation

◆ value_type

template<class T >
using gsl::not_null< T >::value_type = typename std::conditional<std::is_copy_constructible<T>::value, T, const T&>::type

Definition at line 68 of file not_null.h.

Constructor & Destructor Documentation

◆ not_null() [1/5]

template<class T >
template<class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
constexpr gsl::not_null< T >::not_null ( U &&  u)
inlineconstexpr

Definition at line 74 of file not_null.h.

◆ not_null() [2/5]

template<class T >
template<class = typename std::enable_if<!std::is_same<std::nullptr_t, T>::value>::type>
constexpr gsl::not_null< T >::not_null ( u)
inlineconstexpr

Definition at line 77 of file not_null.h.

◆ not_null() [3/5]

template<class T >
template<class U , class = typename std::enable_if<std::is_convertible<U, T>::value>::type>
constexpr gsl::not_null< T >::not_null ( const not_null< U > &  other)
inlineconstexpr

Definition at line 80 of file not_null.h.

◆ not_null() [4/5]

template<class T >
gsl::not_null< T >::not_null ( const not_null< T > &  other)
default

◆ not_null() [5/5]

template<class T >
gsl::not_null< T >::not_null ( std::nullptr_t  )
delete

Member Function Documentation

◆ get()

template<class T >
constexpr value_type gsl::not_null< T >::get ( ) const
inlineconstexpr

◆ operator T()

template<class T >
constexpr gsl::not_null< T >::operator T ( ) const
inlineconstexpr

Definition at line 89 of file not_null.h.

References gsl::not_null< T >::get().

◆ operator*()

template<class T >
constexpr std::remove_pointer<value_type>::type gsl::not_null< T >::operator* ( ) const
inlineconstexpr

Definition at line 91 of file not_null.h.

References gsl::not_null< T >::get().

◆ operator++() [1/2]

template<class T >
not_null& gsl::not_null< T >::operator++ ( )
delete

◆ operator++() [2/2]

template<class T >
not_null gsl::not_null< T >::operator++ ( int  )
delete

◆ operator+=()

template<class T >
not_null& gsl::not_null< T >::operator+= ( std::ptrdiff_t  )
delete

◆ operator--() [1/2]

template<class T >
not_null& gsl::not_null< T >::operator-- ( )
delete

◆ operator--() [2/2]

template<class T >
not_null gsl::not_null< T >::operator-- ( int  )
delete

◆ operator-=()

template<class T >
not_null& gsl::not_null< T >::operator-= ( std::ptrdiff_t  )
delete

◆ operator->()

template<class T >
constexpr value_type gsl::not_null< T >::operator-> ( ) const
inlineconstexpr

Definition at line 90 of file not_null.h.

References gsl::not_null< T >::get().

◆ operator=() [1/2]

template<class T >
not_null& gsl::not_null< T >::operator= ( const not_null< T > &  other)
default

◆ operator=() [2/2]

template<class T >
not_null& gsl::not_null< T >::operator= ( std::nullptr_t  )
delete

◆ operator[]()

template<class T >
void gsl::not_null< T >::operator[] ( std::ptrdiff_t  ) const
delete

Field Documentation

◆ ptr_

template<class T >
T gsl::not_null< T >::ptr_
private

Definition at line 107 of file not_null.h.

Referenced by gsl::not_null< T >::get().


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