8template<
class T,
class PTR_TYPE = T*,
class CPTR_TYPE = const T*>
class raii_base
10 PTR_TYPE d_ = PTR_TYPE();
16 virtual void dec(PTR_TYPE d) = 0;
17 virtual void inc(PTR_TYPE d) = 0;
57 PTR_TYPE&
reset(PTR_TYPE p = PTR_TYPE())
64 operator PTR_TYPE() noexcept
69 operator CPTR_TYPE() const noexcept
84 PTR_TYPE
get() noexcept
89 CPTR_TYPE
get() const noexcept
103 virtual void dec(T d) = 0;
104 virtual void inc(T d) = 0;
151 operator T() noexcept
156 operator const T() const noexcept
176 const T
get() const noexcept
raii_base & operator=(T d)
Definition: raii.h:106
T & operator*()
Definition: raii.h:161
raii_base(T d) noexcept
Definition: raii.h:133
void swap(raii_base &o) noexcept
Definition: raii.h:126
T & reset(T p=T())
Definition: raii.h:144
T release()
Definition: raii.h:137
raii_base() noexcept=default
~raii_base()=default
Child classes need to add reset();.
const T get() const noexcept
Definition: raii.h:176
const T & operator*() const
Definition: raii.h:166
T get() noexcept
Definition: raii.h:171
raii_base & operator=(PTR_TYPE d)
Definition: raii.h:19
~raii_base()=default
Child classes need to add reset();.
raii_base(PTR_TYPE d) noexcept
Definition: raii.h:46
T & operator*()
Definition: raii.h:74
PTR_TYPE & reset(PTR_TYPE p=PTR_TYPE())
Definition: raii.h:57
raii_base() noexcept=default
PTR_TYPE get() noexcept
Definition: raii.h:84
PTR_TYPE release()
Definition: raii.h:50
void swap(raii_base &o) noexcept
Definition: raii.h:39
const T & operator*() const
Definition: raii.h:79
virtual void inc(PTR_TYPE d)=0
CPTR_TYPE get() const noexcept
Definition: raii.h:89
virtual void dec(PTR_TYPE d)=0
Base namespace for everything not included in the global namespace.
Definition: field_source.h:8