30 template <typename T2, typename = std::enable_if_t<std::is_convertible<T2*, T*>::value>>
39 template <typename T2, typename = std::enable_if_t<std::is_convertible<T2*, T*>::value>>
55 INLINE explicit operator bool()
const {
56 return ptr !=
nullptr;
76 template <
typename T1,
typename T2>
78 return dynamic_cast<T1*
>(source.
get());
83 return std::addressof(ref);
101 template <
typename T>
106 template <
typename T1,
typename T2>
108 return lhs.
get() == rhs.
get();
111 template <
typename T1,
typename T2>
113 return lhs.
get() != rhs.
get();
116 template <
typename T>
118 return lhs.
get() < rhs.
get();
124 template <
typename T>
125 void swap(Sph::RawPtr<T>& p1, Sph::RawPtr<T>& p2) {
#define SPH_ASSERT(x,...)
#define INLINE
Macros for conditional compilation based on selected compiler.
#define NAMESPACE_SPH_END
INLINE bool operator<(const RawPtr< T > &lhs, const RawPtr< T > &rhs)
INLINE RawPtr< T1 > dynamicCast(RawPtr< T2 > source)
INLINE RawPtr< T > addressOf(T &ref)
INLINE bool operator==(const RawPtr< T > lhs, std::nullptr_t)
INLINE bool operator!=(const RawPtr< T > lhs, std::nullptr_t)
Non-owning wrapper of pointer.
INLINE RawPtr & operator=(std::nullptr_t)
INLINE bool operator!() const
INLINE RawPtr(std::nullptr_t)
INLINE void swap(RawPtr &other)
INLINE T & operator*() const
INLINE RawPtr & operator=(T2 *rhs)
INLINE T * operator->() const
Overload of std::swap for Sph::Array.
void swap(Sph::Array< T, TCounter > &ar1, Sph::Array< T, TCounter > &ar2)