Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting Object. This pointer type follows intrusive pointer semantics. Reference counter is stored either in Object itself or in counter structure which is tied to Object instance tightly. In any case, all SmartPtr instances form single ownership group regardless how they were created which is unlike how std::shared_ptr class behaves. Converting raw pointer to SmartPtr is safe given there are other SmartPtr instances holding shared references to the same object. SmartPtr class instance can be in one of two states: shared pointer and weak pointer. To keep object alive, one should have count of shared references to it positive. Both weak and shared pointers can be used to access pointed object (to call methods, read or write fields, etc.), but weak pointers do not participate to shared pointer reference counting. Object is being deleted when the last 'shared' SmartPtr pointer to it is being destroyed. So, make sure that this doesn't happen when no other shared SmartPtr pointers to object exist, e. g. during object construction or destruction. Use System::Object::ThisProtector sentry objects (in C++ code) or CppCTORSelfReference or CppSelfReference attribute (in C# code being ported) to fix this issue. Similarily, make sure to break loop references by using System::WeakPtr pointer class or System::SmartPtrMode::Weak pointer mode (in C++ code) or CppWeakPtr attribute (in C# code being ported). If two or more objects reference each other using 'shared' pointers, they will never be deleted. If pointer type (weak or shared) should be switched in runtime, use System::SmartPtr<T>::set_Mode() method or System::DynamicWeakPtr class. SmartPtr class doesn't contain any virtual methods. You should only inherit it if you're creating a memory management strategy of your own. This type is a pointer to manage other object's deletion. It should be allocated on stack and passed to functions either by value or by const reference. More...

#include "fwd.h"

Inherited by System::Collections::Generic::ListPtr< TItem >, System::Collections::BitArrayPtr, System::Collections::Generic::DictionaryPtr< T, V >, System::Collections::Generic::HashSetPtr< T >, System::Collections::Generic::ListPtr< T >, System::Collections::Generic::QueuePtr< T >, System::Collections::Generic::SortedDictionaryPtr< T, V >, System::Collections::Generic::StackPtr< T >, System::Collections::Specialized::StringCollectionPtr, System::DynamicWeakPtr< T, trunkMode, weakLeafs >, System::Security::Cryptography::X509Certificates::X509Certificate2CollectionPtr, System::Security::Cryptography::X509Certificates::X509CertificateCollectionPtr, System::Text::RegularExpressions::GroupCollectionPtr, and System::WeakPtr< T >.

Public Types

typedef T Pointee_
 Pointed type. More...
 
typedef SmartPtr< T > SmartPtr_
 Specialized smart pointer type. More...
 
typedef System::Details::ArrayTypeResolver< T >::type ArrayType
 Same as Pointee_, if it is a specialization of System::Array, and void otherwise. More...
 
using ValueType = typename System::Details::SelectType< typename System::Details::ArrayTypeResolver< T >::value_type >::type
 Storage type of pointed array. Only meaningful if T is a specialization of System::Array. More...
 

Public Member Functions

 SmartPtr (SmartPtrMode mode)
 Creates SmartPtr object of required mode. More...
 
 SmartPtr (std::nullptr_t=nullptr, SmartPtrMode mode=SmartPtrMode::Shared)
 Creates null-pointer SmartPtr object of required mode. More...
 
 SmartPtr (Pointee_ *object, SmartPtrMode mode=SmartPtrMode::Shared)
 Creates SmartPtr pointing to specified object, or converts raw pointer to SmartPtr. More...
 
 SmartPtr (const SmartPtr_ &ptr, SmartPtrMode mode=SmartPtrMode::Shared)
 Copy constructs SmartPtr object. Both pointers point to the same object afterwards. More...
 
template<class Q , typename = typename std::enable_if<std::is_convertible<Q*, Pointee_*>::value>::type>
 SmartPtr (const SmartPtr< Q > &x, SmartPtrMode mode=SmartPtrMode::Shared)
 Copy constructs SmartPtr object. Both pointers point to the same object afterwards. Performs type conversion if allowed. More...
 
 SmartPtr (SmartPtr_ &&x, SmartPtrMode mode=SmartPtrMode::Shared) noexcept
 Move constructs SmartPtr object. Effectively, swaps two pointers, if they are both of same mode. x may be unusable after call. More...
 
template<typename Y >
 SmartPtr (const SmartPtr< Array< Y >> &src, SmartPtrMode mode=SmartPtrMode::Shared)
 Converts type of referenced array by creating a new array of different type. Useful if in C# there is an array type cast which is unsupported in C++. More...
 
template<typename Y , typename = typename std::enable_if<std::is_same<Y, EmptyArrayInitializer>::value, void>::type>
 SmartPtr (const Y &)
 Initializes empty array. Used to port some C# code constructs. More...
 
template<typename P >
 SmartPtr (const SmartPtr< P > &ptr, Pointee_ *p, SmartPtrMode mode=SmartPtrMode::Shared)
 Constructs a SmartPtr which shares ownership information with the initial value of ptr, but holds an unrelated and unmanaged pointer p. More...
 
 ~SmartPtr ()
 Destroys SmartPtr object. If required, decreases pointed object's reference counter and deletes object. More...
 
SmartPtr_operator= (SmartPtr_ &&x) noexcept
 Move-assigns SmartPtr object. x becomes unusable. More...
 
SmartPtr_operator= (const SmartPtr_ &x)
 Copy-assigns SmartPtr object. More...
 
template<typename Q >
SmartPtr_operator= (const SmartPtr< Q > &x)
 Copy-assigns SmartPtr object. Does required type conversions. More...
 
SmartPtr_operator= (Pointee_ *p)
 Assigns raw pointer to SmartPtr object. More...
 
SmartPtr_operator= (std::nullptr_t)
 Sets pointer value to nullptr. More...
 
Pointee_operator-> () const
 Allows to access members of referenced object. More...
 
bool operator== (std::nullptr_t) const
 Checks if pointer points to nullptr. More...
 
Pointee_get () const
 Gets pointed object. More...
 
Pointee_get_shared () const
 Gets pointed object, but asserts that pointer is in shared mode. More...
 
void reset (Pointee_ *ptr)
 Sets pointed object. More...
 
void reset ()
 Makes pointer pointing to nullptr. More...
 
SmartPtrMode get_Mode () const
 Gets pointer mode. More...
 
bool IsShared () const
 Checks if pointer is in shared mode. More...
 
bool IsWeak () const
 Checks if pointer is in weak mode. More...
 
void set_Mode (SmartPtrMode mode)
 Sets pointer mode. May alter referenced object's reference counts. More...
 
Pointee_operator* () const
 Gets reference to pointed object. Asserts that pointer is not null. More...
 
 operator bool () const noexcept
 Checks if pointer is not null. More...
 
bool operator! () const noexcept
 Checks if pointer is null. More...
 
template<class Y >
bool operator< (Y *p) const
 Provides less-compare semantics for SmartPtr class. More...
 
template<class Y >
bool operator< (SmartPtr< Y > const &x) const
 Provides less-compare semantics for SmartPtr class. More...
 
template<class Y >
SmartPtr< Y > static_pointer_cast () const
 Casts pointer to different type using static_cast on pointed object. More...
 
template<class Y >
SmartPtr< Y > dynamic_pointer_cast () const
 Casts pointer to different type using dynamic_cast on pointed object. More...
 
template<class Y >
SmartPtr< Y > const_pointer_cast () const
 Casts pointer to different type using const_cast on pointed object. More...
 
bool Is (const System::TypeInfo &target) const
 Checks if pointed object is of specific type or its child type. Follows C# 'is' semantics. More...
 
ObjectGetObjectOrNull () const
 Gets pointed object (if any) or nullptr. Same as get(). More...
 
SmartPtr< ObjectToObjectPtr () const
 Converts any pointer type to pointer to Object. Doesn't require Pointee_ type to be complete. More...
 
Pointee_GetPointer () const
 Gets pointed object (if any) or nullptr. Same as get(). More...
 
int get_shared_count () const
 Gets number of shared pointers existing to referenced object, including current one. Asserts current pointer being in shared mode. More...
 
void SetContainedTemplateWeakPtr (unsigned int argument) const
 Calls SetTemplateWeakPtr() method on pointed object (if any). More...
 
template<typename Q = T>
auto begin () noexcept -> decltype(std::declval< Q >().begin())
 Accessor for begin() method of an underling collection. Only compiles if SmartPtr_ is specialization type with begin() method. More...
 
template<typename Q = T>
auto end () noexcept -> decltype(std::declval< Q >().end())
 Accessor for end() method of an underling collection. Only compiles if SmartPtr_ is specialization type with end() method. More...
 
template<typename Q = T>
auto begin () const noexcept -> decltype(std::declval< const Q >().begin())
 Accessor for begin() method of an underling collection. Only compiles if SmartPtr_ is specialization type with begin() method. More...
 
template<typename Q = T>
auto end () const noexcept -> decltype(std::declval< const Q >().end())
 Accessor for end() method of an underling collection. Only compiles if SmartPtr_ is specialization type with end() method. More...
 
int GetHashCode () const
 Calls GetHashCode() on pointed object. More...
 
T * GetObjectNotNull () const
 Gets currently referenced object (if any) or throws. More...
 

Static Public Member Functions

static const System::TypeInfoType ()
 Shortcut to get System::TypeInfo object for the Pointee_ type. More...
 

Public Attributes

template<typename IdxType >
decltype(System::Details::GetByIndex(std::declval< const SmartPtr_ * >(), std::declval< IdxType >()) operator[] )(IdxType idx) const
 Accessor for array elements. Only compiles if SmartPtr_ is specialization of System::Array. More...
 

Detailed Description

template<class T>
class System::SmartPtr< T >

Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting Object. This pointer type follows intrusive pointer semantics. Reference counter is stored either in Object itself or in counter structure which is tied to Object instance tightly. In any case, all SmartPtr instances form single ownership group regardless how they were created which is unlike how std::shared_ptr class behaves. Converting raw pointer to SmartPtr is safe given there are other SmartPtr instances holding shared references to the same object. SmartPtr class instance can be in one of two states: shared pointer and weak pointer. To keep object alive, one should have count of shared references to it positive. Both weak and shared pointers can be used to access pointed object (to call methods, read or write fields, etc.), but weak pointers do not participate to shared pointer reference counting. Object is being deleted when the last 'shared' SmartPtr pointer to it is being destroyed. So, make sure that this doesn't happen when no other shared SmartPtr pointers to object exist, e. g. during object construction or destruction. Use System::Object::ThisProtector sentry objects (in C++ code) or CppCTORSelfReference or CppSelfReference attribute (in C# code being ported) to fix this issue. Similarily, make sure to break loop references by using System::WeakPtr pointer class or System::SmartPtrMode::Weak pointer mode (in C++ code) or CppWeakPtr attribute (in C# code being ported). If two or more objects reference each other using 'shared' pointers, they will never be deleted. If pointer type (weak or shared) should be switched in runtime, use System::SmartPtr<T>::set_Mode() method or System::DynamicWeakPtr class. SmartPtr class doesn't contain any virtual methods. You should only inherit it if you're creating a memory management strategy of your own. This type is a pointer to manage other object's deletion. It should be allocated on stack and passed to functions either by value or by const reference.

Template Parameters
TType of the pointed object. Must be either System::Object or subclass of it.

Member Typedef Documentation

◆ ArrayType

template<class T>
typedef System::Details::ArrayTypeResolver<T>::type System::SmartPtr< T >::ArrayType

Same as Pointee_, if it is a specialization of System::Array, and void otherwise.

◆ Pointee_

template<class T>
typedef T System::SmartPtr< T >::Pointee_

Pointed type.

◆ SmartPtr_

template<class T>
typedef SmartPtr<T> System::SmartPtr< T >::SmartPtr_

Specialized smart pointer type.

◆ ValueType

template<class T>
using System::SmartPtr< T >::ValueType = typename System::Details::SelectType<typename System::Details::ArrayTypeResolver<T>::value_type>::type

Storage type of pointed array. Only meaningful if T is a specialization of System::Array.

Constructor & Destructor Documentation

◆ SmartPtr() [1/9]

template<class T>
System::SmartPtr< T >::SmartPtr ( SmartPtrMode  mode)
inline

Creates SmartPtr object of required mode.

Parameters
modePointer mode.

◆ SmartPtr() [2/9]

template<class T>
System::SmartPtr< T >::SmartPtr ( std::nullptr_t  = nullptr,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inline

Creates null-pointer SmartPtr object of required mode.

Parameters
modePointer mode.

◆ SmartPtr() [3/9]

template<class T>
System::SmartPtr< T >::SmartPtr ( Pointee_ object,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inline

Creates SmartPtr pointing to specified object, or converts raw pointer to SmartPtr.

Parameters
objectPointee.
modePointer mode.

◆ SmartPtr() [4/9]

template<class T>
System::SmartPtr< T >::SmartPtr ( const SmartPtr_ ptr,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inline

Copy constructs SmartPtr object. Both pointers point to the same object afterwards.

Parameters
ptrPointer to copy.
modePointer mode.

◆ SmartPtr() [5/9]

template<class T>
template<class Q , typename = typename std::enable_if<std::is_convertible<Q*, Pointee_*>::value>::type>
System::SmartPtr< T >::SmartPtr ( const SmartPtr< Q > &  x,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inline

Copy constructs SmartPtr object. Both pointers point to the same object afterwards. Performs type conversion if allowed.

Template Parameters
QType of object pointed by x.
Parameters
xPointer to copy.
modePointer mode.

◆ SmartPtr() [6/9]

template<class T>
System::SmartPtr< T >::SmartPtr ( SmartPtr_ &&  x,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inlinenoexcept

Move constructs SmartPtr object. Effectively, swaps two pointers, if they are both of same mode. x may be unusable after call.

Parameters
xPointer to move.
modePointer mode.

◆ SmartPtr() [7/9]

template<class T>
template<typename Y >
System::SmartPtr< T >::SmartPtr ( const SmartPtr< Array< Y >> &  src,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inlineexplicit

Converts type of referenced array by creating a new array of different type. Useful if in C# there is an array type cast which is unsupported in C++.

Template Parameters
YType of source array.
Parameters
srcPointer to array to create a copy of, but with different type of elements.
modePointer mode.

◆ SmartPtr() [8/9]

template<class T>
template<typename Y , typename = typename std::enable_if<std::is_same<Y, EmptyArrayInitializer>::value, void>::type>
System::SmartPtr< T >::SmartPtr ( const Y &  )
inlineexplicit

Initializes empty array. Used to port some C# code constructs.

Template Parameters
YPlaceholder of EmptyArrayInitializer type.

◆ SmartPtr() [9/9]

template<class T>
template<typename P >
System::SmartPtr< T >::SmartPtr ( const SmartPtr< P > &  ptr,
Pointee_ p,
SmartPtrMode  mode = SmartPtrMode::Shared 
)
inline

Constructs a SmartPtr which shares ownership information with the initial value of ptr, but holds an unrelated and unmanaged pointer p.

Parameters
ptrAnother smart pointer to share the ownership to the ownership from.
pPointer to an object to manage.
modePointer mode.

◆ ~SmartPtr()

template<class T>
System::SmartPtr< T >::~SmartPtr ( )
inline

Destroys SmartPtr object. If required, decreases pointed object's reference counter and deletes object.

Member Function Documentation

◆ begin() [1/2]

template<class T>
template<typename Q = T>
auto System::SmartPtr< T >::begin ( ) const -> decltype(std::declval<const Q>().begin())
inlinenoexcept

Accessor for begin() method of an underling collection. Only compiles if SmartPtr_ is specialization type with begin() method.

Returns
iterator to the begin of collection

◆ begin() [2/2]

template<class T>
template<typename Q = T>
auto System::SmartPtr< T >::begin ( ) -> decltype(std::declval<Q>().begin())
inlinenoexcept

Accessor for begin() method of an underling collection. Only compiles if SmartPtr_ is specialization type with begin() method.

Returns
iterator to the begin of collection

◆ const_pointer_cast()

template<class T>
template<class Y >
SmartPtr<Y> System::SmartPtr< T >::const_pointer_cast ( ) const
inline

Casts pointer to different type using const_cast on pointed object.

Template Parameters
YTarget type of pointed object.
Returns
Pointer of changed type which is always in shared mode.

◆ dynamic_pointer_cast()

template<class T>
template<class Y >
SmartPtr<Y> System::SmartPtr< T >::dynamic_pointer_cast ( ) const
inline

Casts pointer to different type using dynamic_cast on pointed object.

Template Parameters
YTarget type of pointed object.
Returns
Pointer of changed type which is always in shared mode.

◆ end() [1/2]

template<class T>
template<typename Q = T>
auto System::SmartPtr< T >::end ( ) const -> decltype(std::declval<const Q>().end())
inlinenoexcept

Accessor for end() method of an underling collection. Only compiles if SmartPtr_ is specialization type with end() method.

Returns
iterator to the end of collection

◆ end() [2/2]

template<class T>
template<typename Q = T>
auto System::SmartPtr< T >::end ( ) -> decltype(std::declval<Q>().end())
inlinenoexcept

Accessor for end() method of an underling collection. Only compiles if SmartPtr_ is specialization type with end() method.

Returns
iterator to the end of collection

◆ get()

template<class T>
Pointee_* System::SmartPtr< T >::get ( ) const
inline

Gets pointed object.

Returns
Raw pointer to referenced object.

◆ get_Mode()

template<class T>
SmartPtrMode System::SmartPtr< T >::get_Mode ( ) const
inline

Gets pointer mode.

Returns
Mode of pointer object.

◆ get_shared()

template<class T>
Pointee_* System::SmartPtr< T >::get_shared ( ) const
inline

Gets pointed object, but asserts that pointer is in shared mode.

Returns
Raw pointer to referenced object.

◆ get_shared_count()

template<class T>
int System::SmartPtr< T >::get_shared_count ( ) const
inline

Gets number of shared pointers existing to referenced object, including current one. Asserts current pointer being in shared mode.

Returns
Number of shared pointers existing to referenced object, if any. If pointer is null, returns 0.

◆ GetHashCode()

template<class T>
int System::SmartPtr< T >::GetHashCode ( ) const
inline

Calls GetHashCode() on pointed object.

Returns
Result of GetHashCode() call on referenced object (if any) or 0.

◆ GetObjectNotNull()

template<class T>
T* System::SmartPtr< T >::GetObjectNotNull ( ) const
inline

Gets currently referenced object (if any) or throws.

Returns
Raw pointer to referenced object.
Exceptions
System::NullReferenceExceptionThrown if called on null-pointer.

◆ GetObjectOrNull()

template<class T>
Object* System::SmartPtr< T >::GetObjectOrNull ( ) const
inline

Gets pointed object (if any) or nullptr. Same as get().

Returns
Raw pointer to referenced object (if any) or nullptr.

◆ GetPointer()

template<class T>
Pointee_* System::SmartPtr< T >::GetPointer ( ) const
inline

Gets pointed object (if any) or nullptr. Same as get().

Returns
Raw pointer to referenced object (if any) or nullptr.

◆ Is()

template<typename T >
bool System::SmartPtr< T >::Is ( const System::TypeInfo target) const

Checks if pointed object is of specific type or its child type. Follows C# 'is' semantics.

Implementation.

Parameters
targetSpecifies target type to check against.
Returns
True if C# 'is'-style check is positive and false otherwise.

◆ IsShared()

template<class T>
bool System::SmartPtr< T >::IsShared ( ) const
inline

Checks if pointer is in shared mode.

Returns
True if pointer is in shared mode, false otherwise.

◆ IsWeak()

template<class T>
bool System::SmartPtr< T >::IsWeak ( ) const
inline

Checks if pointer is in weak mode.

Returns
True if pointer is in weak mode, false otherwise.

◆ operator bool()

template<class T>
System::SmartPtr< T >::operator bool ( ) const
inlineexplicitnoexcept

Checks if pointer is not null.

Returns
False if pointer is null, true otherwise.

◆ operator!()

template<class T>
bool System::SmartPtr< T >::operator! ( ) const
inlinenoexcept

Checks if pointer is null.

Returns
True if pointer is null, false otherwise.

◆ operator*()

template<class T>
Pointee_& System::SmartPtr< T >::operator* ( ) const
inline

Gets reference to pointed object. Asserts that pointer is not null.

Returns
Reference to pointed object.

◆ operator->()

template<class T>
Pointee_* System::SmartPtr< T >::operator-> ( ) const
inline

Allows to access members of referenced object.

Returns
Raw pointer to referenced object.
Exceptions
System::NullReferenceExceptionIf pointer is null.

◆ operator<() [1/2]

template<class T>
template<class Y >
bool System::SmartPtr< T >::operator< ( SmartPtr< Y > const &  x) const
inline

Provides less-compare semantics for SmartPtr class.

Template Parameters
YType of pointer to compare current one to.
Parameters
xPointer to compare current one to.
Returns
True if the object referenced by SmartPtr is 'less' than x and false otherwise.

◆ operator<() [2/2]

template<class T>
template<class Y >
bool System::SmartPtr< T >::operator< ( Y *  p) const
inline

Provides less-compare semantics for SmartPtr class.

Template Parameters
YType of pointer to compare current one to.
Parameters
pPointer to compare current one to.
Returns
True if the object referenced by SmartPtr is 'less' than p and false otherwise.

◆ operator=() [1/5]

template<class T>
template<typename Q >
SmartPtr_& System::SmartPtr< T >::operator= ( const SmartPtr< Q > &  x)
inline

Copy-assigns SmartPtr object. Does required type conversions.

Template Parameters
QType of object pointed by x.
Parameters
xPointer to copy-assign.
Returns
Reference to this object.

◆ operator=() [2/5]

template<class T>
SmartPtr_& System::SmartPtr< T >::operator= ( const SmartPtr_ x)
inline

Copy-assigns SmartPtr object.

Parameters
xPointer to copy-assign.
Returns
Reference to this object.

◆ operator=() [3/5]

template<class T>
SmartPtr_& System::SmartPtr< T >::operator= ( Pointee_ p)
inline

Assigns raw pointer to SmartPtr object.

Parameters
pPointer value to assign.
Returns
Reference to this object.

◆ operator=() [4/5]

template<class T>
SmartPtr_& System::SmartPtr< T >::operator= ( SmartPtr_ &&  x)
inlinenoexcept

Move-assigns SmartPtr object. x becomes unusable.

Parameters
xPointer to move-assign.
Returns
Reference to this object.

◆ operator=() [5/5]

template<class T>
SmartPtr_& System::SmartPtr< T >::operator= ( std::nullptr_t  )
inline

Sets pointer value to nullptr.

Returns
Reference to this object.

◆ operator==()

template<class T>
bool System::SmartPtr< T >::operator== ( std::nullptr_t  ) const
inline

Checks if pointer points to nullptr.

Returns
True if pointer points to nullptr and false otherwise.

◆ reset() [1/2]

template<class T>
void System::SmartPtr< T >::reset ( )
inline

Makes pointer pointing to nullptr.

◆ reset() [2/2]

template<class T>
void System::SmartPtr< T >::reset ( Pointee_ ptr)
inline

Sets pointed object.

Parameters
ptrRaw pointer to new referenced object.

◆ set_Mode()

template<class T>
void System::SmartPtr< T >::set_Mode ( SmartPtrMode  mode)
inline

Sets pointer mode. May alter referenced object's reference counts.

Parameters
modeNew mode of pointer.

◆ SetContainedTemplateWeakPtr()

template<typename T >
void System::SmartPtr< T >::SetContainedTemplateWeakPtr ( unsigned int  argument) const

Calls SetTemplateWeakPtr() method on pointed object (if any).

Implementation.

Parameters
argumentArgument of SetTemplateWeakPtr method called on referenced object.

◆ static_pointer_cast()

template<class T>
template<class Y >
SmartPtr<Y> System::SmartPtr< T >::static_pointer_cast ( ) const
inline

Casts pointer to different type using static_cast on pointed object.

Template Parameters
YTarget type of pointed object.
Returns
Pointer of changed type which is always in shared mode.

◆ ToObjectPtr()

template<typename T >
SmartPtr< Object > System::SmartPtr< T >::ToObjectPtr ( ) const

Converts any pointer type to pointer to Object. Doesn't require Pointee_ type to be complete.

Implementation.

Returns
Raw pointer to referenced object (if any) or nullptr.

◆ Type()

template<class T>
static const System::TypeInfo& System::SmartPtr< T >::Type ( )
inlinestatic

Shortcut to get System::TypeInfo object for the Pointee_ type.

Returns
Const reference to TypeInfo structure which describes Pointee_ type.

Member Data Documentation

◆ operator[]

template<class T>
template<typename IdxType >
decltype(System::Details::GetByIndex(std::declval<const SmartPtr_*>(), std::declval<IdxType>()) System::SmartPtr< T >::operator[]) (IdxType idx) const
inline

Accessor for array elements. Only compiles if SmartPtr_ is specialization of System::Array.

Template Parameters
IdxTypeType of index (assumed integral).
Parameters
idxIndex in array.
Returns
Array value at idx position.