19 #ifndef itkSmartPointer_h
20 #define itkSmartPointer_h
24 #include <type_traits>
25 #include "itkConfigure.h"
50 template<
typename TObjectType >
57 typename std::enable_if<std::is_convertible<T*, TObjectType*>::value>;
75 typename =
typename EnableIfConvertible<T>::type>
85 { p.m_Pointer =
nullptr; }
89 typename =
typename EnableIfConvertible<T>::type >
92 { p.m_Pointer =
nullptr; }
114 explicit operator bool() const noexcept
168 ( *m_Pointer ).Print(os);
174 #if ! defined ( ITK_LEGACY_REMOVE )
185 other.m_Pointer = tmp;
208 template <
class T,
class TU >
210 {
return ( l.GetPointer() == r.GetPointer() ); }
216 {
return (
nullptr == r.GetPointer() ); }
220 template <
class T,
class TU >
222 {
return ( l.GetPointer() != r.GetPointer() ); }
228 {
return (
nullptr != r.GetPointer() ); }
233 template <
class T,
class TU >
235 {
return ( l.GetPointer() < r.GetPointer() ); }
238 template <
class T,
class TU >
240 {
return ( l.GetPointer() > r.GetPointer() ); }
243 template <
class T,
class TU >
245 {
return ( l.GetPointer() <= r.GetPointer() ); }
248 template <
class T,
class TU >
250 {
return ( l.GetPointer() >= r.GetPointer() ); }
252 template<
typename T >
253 std::ostream & operator<<(std::ostream & os, SmartPointer< T > p)
constexpr SmartPointer() noexcept
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
void UnRegister() noexcept
SmartPointer(SmartPointer< ObjectType > &&p) noexcept
ObjectType * GetPointer() const noexcept
bool operator>(const Index< VDimension > &one, const Index< VDimension > &two)
SmartPointer(const SmartPointer< T > &p) noexcept
SmartPointer & operator=(SmartPointer r) noexcept
bool IsNotNull() const noexcept
SmartPointer(const SmartPointer &p) noexcept
void swap(Array< T > &a, Array< T > &b)
ObjectType * operator->() const noexcept
bool operator!=(const Index< VDimension > &one, const Index< VDimension > &two)
SmartPointer & operator=(std::nullptr_t) noexcept
bool IsNull() const noexcept
typename std::enable_if< std::is_convertible< T *, const Self * >::value > EnableIfConvertible
SmartPointer(ObjectType *p) noexcept
ObjectType & operator*() const noexcept
Implements transparent reference counting.
SmartPointer(SmartPointer< T > &&p) noexcept
ObjectType * Print(std::ostream &os) const
constexpr SmartPointer(std::nullptr_t p) noexcept
bool operator>=(const Index< VDimension > &one, const Index< VDimension > &two)
void Swap(SmartPointer &other) noexcept