System::ExplicitCast method

System::ExplicitCast(const Source&) method

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

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::None, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used when simple constructor-like cast is needed.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Static, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for exception wrappers.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Exception, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for casting object to exception.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::ObjectToException, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used when the source and result both are smart pointers (without expicit SmartPtr<…> in result type).

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Pointer, typename CastResult<Result>::type> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used when the source and result both are smart pointers (with expicit SmartPtr<…> in result type).

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::PointerToPointer, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for unboxing object to nullable.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::UnboxingToNullable, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used to box nullable.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::NullableBoxing, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for unboxing nullable object.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::NullableUnboxing, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for enum boxing.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::EnumBoxing, SmartPtr<BoxedValueBase>> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for common boxing.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Boxing, typename CastResult<Result>::type> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for System::String boxing.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::StringBoxing, typename CastResult<Result>::type> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for common unboxing.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Unboxing, Result> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for nullptr casting.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Null, typename CastResult<Result>::type> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(const Source&) method

Casts the source type to the result type using explicit cast. Used for casting between arrays.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Array, typename CastResult<Result>::type> System::ExplicitCast(const Source &value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueconst Source&Object to cast.

ReturnValue

The cast result.

See Also

System::ExplicitCast(Source) method

Casts the source type to the result type using explicit cast. Used when the casting raw pointer to smart pointer.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::RawPointer, typename CastResult<std::remove_pointer_t<Result>>::type> System::ExplicitCast(Source value)
ParameterDescription
SourceThe source type.
ResultThe result type.
ParameterTypeDescription
valueSourceObject to cast.

ReturnValue

The cast result.

See Also