AsCast()

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator 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::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator 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::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for exception wrappers.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Exception, Result> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result. Returns nullptr if no conversion available.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for casting object to exception.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::ObjectToException, Result> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result. Returns nullptr if no conversion available.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used when the source and result both are smart pointers.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Pointer, typename CastResult<Result>::type> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result. Returns nullptr if no conversion available.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator 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::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result. Returns nullptr if no conversion available.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for unboxing object to nullable.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::UnboxingToNullable, Result> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result. Returns empty nullable if no conversion available.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for boxing nullable object.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::NullableBoxing, Result> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for boxing common object.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Boxing, typename CastResult<Result>::type> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for string unboxing.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::UnboxingToString, Result> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used for nullptr casing.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Null, typename CastResult<Result>::type> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result.

System::AsCast(const Source&) function

Casts the source type to the result type using ‘as’ operator cast. Used to cast between arrays.

template<typename Result,typename Source> std::enable_if_t<Details::CastType<Source, Result>::Array, typename CastResult<Result>::type> System::AsCast(const Source &value)

Template parameters

ParameterDescription
SourceThe source type.
ResultThe result type.

Arguments

ParameterTypeDescription
valueconst Source&Object to cast.

Return Value

The cast result. Returns nullptr if no conversion for any array member is available.

See Also