1 #ifndef _utl_ShadowPtr_h_
2 #define _utl_ShadowPtr_h_
4 #include <utl/ShadowPtr_fwd.h>
19 namespace ShadowPtrMeta {
33 sizeof(MatchCloneTag<T>(0)) ==
sizeof(
True);
36 template<
bool v,
typename T>
38 static T*
GetCopy(
const T& t) {
return new T(t); }
43 static T*
GetCopy(
const T& t) {
return t.Clone(); }
74 {
return Clone(src); }
97 template<
bool v,
int = 0>
99 static T*
GetCopy(
const T& t) {
return new T(t); }
104 static T*
GetCopy(
const T& t) {
return t.Clone(); }
162 template<
typename T,
class DereferenceCheck>
215 explicit operator bool()
const {
return fPtr; }
230 template<
typename T,
class DereferenceCheck>
237 template<
typename T,
class D>
239 {
return (!s1 && !s2) || (s1 && s2 && *s1 == *s2); }
243 template<
typename T,
class D>
pointer with built-in initialization, deletion, deep copying
void swap(utl::Trace< T > &t1, utl::Trace< T > &t2)
ShadowPtr & operator=(ShadowPtr &&sp)
void swap(utl::TabulatedFunction &t1, utl::TabulatedFunction &t2)
const T * operator->() const
bool operator!=(const ShadowPtr &sp) const
ShadowPtr & operator=(const ShadowPtr &sp)
constexpr std::size_t noexcept
void DeepCopy(const T *const p)
ShadowPtr(const ShadowPtr &sp)
const T & operator*() const
bool operator==(const T *const p) const
bool operator==(const ShadowPtr &sp) const
bool DeepEqual(const LameShadowPtr< T, D > &s1, const LameShadowPtr< T, D > &s2)
bool operator!=(const T *const p) const
ShadowPtr(ShadowPtr &&sp) noexcept
ShadowPtr & operator=(T *const p)
shallow assignment: transfer ownership