Classes | Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
cet::exempt_ptr< Element > Class Template Reference

#include <exempt_ptr.h>

Classes

struct  is_compatible
 

Public Types

using element_type = Element
 
using pointer = std::add_pointer_t< Element >
 
using reference = std::add_lvalue_reference_t< Element >
 

Public Member Functions

constexpr exempt_ptr () noexcept
 
constexpr exempt_ptr (std::nullptr_t) noexcept
 
constexpr exempt_ptr (pointer other) noexcept
 
template<class E2 >
constexpr exempt_ptr (E2 *other, std::enable_if_t< is_compatible_v< E2 >> *=nullptr) noexcept
 
template<class E2 >
constexpr exempt_ptr (exempt_ptr< E2 > const other, std::enable_if_t< is_compatible_v< E2 >> *=nullptr) noexcept
 
constexpr exempt_ptroperator= (std::nullptr_t) noexcept
 
template<class E2 >
constexpr std::enable_if_t< is_compatible_v< E2 >, exempt_ptr & > operator= (E2 *other) noexcept
 
template<class E2 >
constexpr std::enable_if_t< is_compatible_v< E2 >, exempt_ptr & > operator= (exempt_ptr< E2 > const other) noexcept
 
constexpr reference operator* () const noexcept
 
constexpr pointer operator-> () const noexcept
 
constexpr pointer get () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr operator bool () const noexcept
 
constexpr pointer release () noexcept
 
constexpr void reset (pointer t=nullptr) noexcept
 
void swap (exempt_ptr &other) noexcept
 

Private Attributes

pointer p
 

Static Private Attributes

template<class P >
static constexpr bool is_compatible_v = is_compatible<P>::value
 

Detailed Description

template<class Element>
class cet::exempt_ptr< Element >

Definition at line 38 of file exempt_ptr.h.

Member Typedef Documentation

template<class Element>
using cet::exempt_ptr< Element >::element_type = Element

Definition at line 83 of file exempt_ptr.h.

template<class Element>
using cet::exempt_ptr< Element >::pointer = std::add_pointer_t<Element>

Definition at line 84 of file exempt_ptr.h.

template<class Element>
using cet::exempt_ptr< Element >::reference = std::add_lvalue_reference_t<Element>

Definition at line 85 of file exempt_ptr.h.

Constructor & Destructor Documentation

template<class Element>
constexpr cet::exempt_ptr< Element >::exempt_ptr ( )
inlinenoexcept

Definition at line 97 of file exempt_ptr.h.

97 : p{nullptr} {}
template<class Element>
constexpr cet::exempt_ptr< Element >::exempt_ptr ( std::nullptr_t  )
inlinenoexcept

Definition at line 100 of file exempt_ptr.h.

100 : p{nullptr} {}
template<class Element>
constexpr cet::exempt_ptr< Element >::exempt_ptr ( pointer  other)
inlineexplicitnoexcept

Definition at line 101 of file exempt_ptr.h.

101 : p{other} {}
template<class Element>
template<class E2 >
constexpr cet::exempt_ptr< Element >::exempt_ptr ( E2 other,
std::enable_if_t< is_compatible_v< E2 >> *  = nullptr 
)
inlinenoexcept

Definition at line 104 of file exempt_ptr.h.

107  : p{other}
108  {}
template<class Element>
template<class E2 >
constexpr cet::exempt_ptr< Element >::exempt_ptr ( exempt_ptr< E2 > const  other,
std::enable_if_t< is_compatible_v< E2 >> *  = nullptr 
)
inlinenoexcept

Definition at line 113 of file exempt_ptr.h.

116  : p{other.get()}
117  {}

Member Function Documentation

template<class Element>
constexpr bool cet::exempt_ptr< Element >::empty ( ) const
inlinenoexcept

Definition at line 153 of file exempt_ptr.h.

154  {
155  return get() == nullptr;
156  }
template<class Element>
constexpr pointer cet::exempt_ptr< Element >::get ( ) const
inlinenoexcept

Definition at line 148 of file exempt_ptr.h.

149  {
150  return p;
151  }
template<class Element>
constexpr cet::exempt_ptr< Element >::operator bool ( ) const
inlineexplicitnoexcept

Definition at line 157 of file exempt_ptr.h.

157 { return !empty(); }
constexpr bool empty() const noexcept
Definition: exempt_ptr.h:153
template<class Element>
constexpr reference cet::exempt_ptr< Element >::operator* ( ) const
inlinenoexcept

Definition at line 145 of file exempt_ptr.h.

145 { return *get(); }
template<class Element>
constexpr pointer cet::exempt_ptr< Element >::operator-> ( ) const
inlinenoexcept

Definition at line 146 of file exempt_ptr.h.

146 { return get(); }
template<class Element>
constexpr exempt_ptr& cet::exempt_ptr< Element >::operator= ( std::nullptr_t  )
inlinenoexcept

Definition at line 120 of file exempt_ptr.h.

121  {
122  reset(nullptr);
123  return *this;
124  }
constexpr void reset(pointer t=nullptr) noexcept
Definition: exempt_ptr.h:168
template<class Element>
template<class E2 >
constexpr std::enable_if_t<is_compatible_v<E2>, exempt_ptr&> cet::exempt_ptr< Element >::operator= ( E2 other)
inlinenoexcept

Definition at line 128 of file exempt_ptr.h.

129  {
130  reset(other);
131  return *this;
132  }
constexpr void reset(pointer t=nullptr) noexcept
Definition: exempt_ptr.h:168
template<class Element>
template<class E2 >
constexpr std::enable_if_t<is_compatible_v<E2>, exempt_ptr&> cet::exempt_ptr< Element >::operator= ( exempt_ptr< E2 > const  other)
inlinenoexcept

Definition at line 138 of file exempt_ptr.h.

139  {
140  reset(other.get());
141  return *this;
142  }
constexpr void reset(pointer t=nullptr) noexcept
Definition: exempt_ptr.h:168
template<class Element>
constexpr pointer cet::exempt_ptr< Element >::release ( )
inlinenoexcept

Definition at line 161 of file exempt_ptr.h.

162  {
163  pointer old = get();
164  reset();
165  return old;
166  }
constexpr void reset(pointer t=nullptr) noexcept
Definition: exempt_ptr.h:168
std::add_pointer_t< Element > pointer
Definition: exempt_ptr.h:84
template<class Element>
constexpr void cet::exempt_ptr< Element >::reset ( pointer  t = nullptr)
inlinenoexcept

Definition at line 168 of file exempt_ptr.h.

169  {
170  p = t;
171  }
template<class Element>
void cet::exempt_ptr< Element >::swap ( exempt_ptr< Element > &  other)
inlinenoexcept

Definition at line 173 of file exempt_ptr.h.

174  {
175  std::swap(p, other.p);
176  }
void swap(exempt_ptr< E > &, exempt_ptr< E > &) noexcept
Definition: exempt_ptr.h:191

Member Data Documentation

template<class Element>
template<class P >
constexpr bool cet::exempt_ptr< Element >::is_compatible_v = is_compatible<P>::value
staticprivate

Definition at line 93 of file exempt_ptr.h.

template<class Element>
pointer cet::exempt_ptr< Element >::p
private

Definition at line 179 of file exempt_ptr.h.


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