System::Collections::Generic::Details::CastRules Namespace Reference

Classes

struct  CastType
 

Functions

template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::None, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Static, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Dynamic, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::NullableBoxing, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::NullableUnboxing, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Boxing, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Unboxing, Result > Cast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Invalid, Result > Cast (Source)
 
template<typename T >
bool IsNull (T)
 
template<typename T >
bool IsNull (SharedPtr< T > value)
 
template<typename T >
bool IsNull (Nullable< T > value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::None, bool > CanCast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Static, bool > CanCast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Dynamic, bool > CanCast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::NullableBoxing, bool > CanCast (Source)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::NullableUnboxing, bool > CanCast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Boxing, bool > CanCast (Source)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Unboxing, bool > CanCast (Source value)
 
template<typename Source , typename Result >
std::enable_if_t< CastType< Source, Result >::Invalid, bool > CanCast (Source)
 

Function Documentation

◆ CanCast() [1/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::None, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  value)

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
True when a non nullptr value is returns after casting, otherwise false.

◆ CanCast() [2/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Static, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  value)

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
True when a non nullptr value is returns after casting, otherwise false.

◆ CanCast() [3/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Dynamic, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  value)

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
True when a non nullptr value is returns after casting, otherwise false.

◆ CanCast() [4/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::NullableBoxing, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  )

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
Always returns true.

◆ CanCast() [5/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::NullableUnboxing, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  value)

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
True when a non nullptr value is returns after casting, otherwise false.

◆ CanCast() [6/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Boxing, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  )

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
Always returns true.

◆ CanCast() [7/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Unboxing, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  value)

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
True if the cast operation was successfully done, otherwise false.

◆ CanCast() [8/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Invalid, bool> System::Collections::Generic::Details::CastRules::CanCast ( Source  )

Checks the cast possibility.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
Always returns false.

◆ Cast() [1/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::None, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the source and the result types are the same.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.

◆ Cast() [2/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Static, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the source type can be statically cast to the result type.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.

◆ Cast() [3/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Dynamic, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the types aren't the same and the source type cannot be statically cast to the result type.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.

◆ Cast() [4/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::NullableBoxing, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the source type is being boxed to the Nullable class instance.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.

◆ Cast() [5/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::NullableUnboxing, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the source type is being unboxed from the Nullable class instance.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.
Exceptions
NullReferenceExceptionIs thrown when the source value is nullptr.

◆ Cast() [6/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Boxing, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the source type is being boxed to the Object class instance.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.

◆ Cast() [7/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Unboxing, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  value)

Casts the source type to the result type. Used when the source type is being unboxed from the Object class instance.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.

◆ Cast() [8/8]

template<typename Source , typename Result >
std::enable_if_t<CastType<Source, Result>::Invalid, Result> System::Collections::Generic::Details::CastRules::Cast ( Source  )

Casts the source type to the result type. Used when the casting is invalid or the conversion is explicit.

Template Parameters
SourceThe source type.
ResultThe result type.
Returns
The cast result.
Exceptions
ThrowInvalidCastExceptionThis exception is always thrown.

◆ IsNull() [1/3]

template<typename T >
bool System::Collections::Generic::Details::CastRules::IsNull ( )

Checks that the represented value is nullptr.

Template Parameters
TThe value type.
Returns
Always returns false.

◆ IsNull() [2/3]

template<typename T >
bool System::Collections::Generic::Details::CastRules::IsNull ( SharedPtr< T >  value)

Checks that the represented value is nullptr.

Template Parameters
TThe value type.
Parameters
valueThe value that must be checked.
Returns
True if the value is nullptr, otherwise false.

◆ IsNull() [3/3]

template<typename T >
bool System::Collections::Generic::Details::CastRules::IsNull ( Nullable< T >  value)

Checks that the represented value is nullptr.

Template Parameters
TThe value type.
Parameters
valueThe value that must be checked.
Returns
True if the value is nullptr, otherwise false.