System::StaticCast-metod

System::StaticCast(const TFrom&) method

Utför en statisk kastning på icke‑pekarobjekt.

template<typename TTo,typename TFrom> std::enable_if<!std::is_same<TFrom, System::String>::value &&!IsExceptionWrapper<TFrom>::value &&!IsSmartPtr<TFrom>::value &&!std::is_arithmetic<TFrom>::value, TTo>::type System::StaticCast(const TFrom &obj)
ParameterBeskrivning
TToMålt typ.
TFromKälltyp.
ParameterTypBeskrivning
objconst TFrom&Källobjekt.

ReturnValue

Kastresultat om kast är tillåtet.

Deprecated

Lämnad för bakåtkompatibilitet. Använd ExplicitCast istället.

Se även

System::StaticCast(const TFrom&) method

Utför statisk cast på Exception objekt.

template<typename TTo,typename TFrom> std::enable_if<IsExceptionWrapper<TFrom>::value &&IsExceptionWrapper<TTo>::value &&(std::is_convertible<TTo, TFrom>::value||std::is_base_of<TTo, TFrom>::value), TTo>::type System::StaticCast(const TFrom &obj)
ParameterBeskrivning
TToMålt Exception typ.
TFromKäll Exception typ.
ParameterTypBeskrivning
objconst TFrom&Källpekare.

ReturnValue

Kastresultat om kast är tillåtet.

Deprecated

Lämnad för bakåtkompatibilitet. Använd ExplicitCast istället.

Se även

System::StaticCast(const TFrom *) method

Specialisering för aritmetiska typer.

template<typename TTo,typename TFrom> std::enable_if<std::is_arithmetic<TFrom>::value, TTo>::type System::StaticCast(const TFrom *value)

Se även

System::StaticCast(SmartPtr<TFrom> const&) method

Utför statisk kast på SmartPtr objekt.

template<typename TTo,typename TFrom> std::enable_if<!IsExceptionWrapper<TTo>::value, typenameCastResult<TTo>::type>::type System::StaticCast(SmartPtr<TFrom> const &obj)
ParameterBeskrivning
TToMålpointee-typ.
TFromKällpointee-typ.
ParameterTypBeskrivning
objSmartPtr<TFrom> const&Källpekare.

ReturnValue

Kastresultat om kast är tillåtet.

Deprecated

Lämnad för bakåtkompatibilitet. Använd ExplicitCast istället.

Se även

System::StaticCast(SmartPtr<TFrom>) method

Utför statisk kast på objekt till Exception objekt.

template<typename TTo,typename TFrom> std::enable_if<std::is_same<System::Object, TFrom>::value &&IsExceptionWrapper<TTo>::value, TTo>::type System::StaticCast(SmartPtr<TFrom> obj) noexcept
ParameterBeskrivning
TToMålt Exception typ.
TFromObject typ.
ParameterTypBeskrivning
objSmartPtr<TFrom>Källpekare.

ReturnValue

Kastresultat om kast är tillåtet.

Deprecated

Lämnad för bakåtkompatibilitet. Använd ExplicitCast istället.

Se även

System::StaticCast(std::nullptr_t) method

Utför statiskt kast av null-objekt.

template<typename TTo> CastResult<TTo>::type System::StaticCast(std::nullptr_t)
ParameterBeskrivning
TToMålpointee-typ.

ReturnValue

nullptr.

Deprecated

Lämnad för bakåtkompatibilitet. Använd ExplicitCast istället.

Se även

System::StaticCast(TFrom) method

Specialisering för aritmetiska typer.

template<typename TTo,typename TFrom> std::enable_if<std::is_arithmetic<TFrom>::value, TTo>::type System::StaticCast(TFrom value)

Se även

System::StaticCast(TTo) method

Bearbeta kast från String till String.

template<typename TTo> std::enable_if<std::is_same<TTo, System::String>::value, TTo>::type System::StaticCast(TTo value)

Se även

System::StaticCast(WeakPtr<TFrom> const&) method

Utför statisk kast på WeakPtr objekt.

template<typename TTo,typename TFrom> CastResult<TTo>::type System::StaticCast(WeakPtr<TFrom> const &obj)
ParameterBeskrivning
TToMålpointee-typ.
TFromKällpointee-typ.
ParameterTypBeskrivning
objWeakPtr<TFrom> const&Källpekare.

ReturnValue

Kastresultat om kast är tillåtet.

Deprecated

Lämnad för bakåtkompatibilitet. Använd ExplicitCast istället.

Se även