Méthode System::StaticCast

System::StaticCast(const TFrom&) method

Effectue un cast statique sur des objets non pointeurs.

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)
ParamètreDescription
TToType cible.
TFromType source.
ParamètreTypeDescription
objconst TFrom&Objet source.

ReturnValue

Résultat du cast si le cast est autorisé.

Deprecated

Conservé pour la compatibilité ascendante. Utilisez ExplicitCast à la place.

Voir aussi

System::StaticCast(const TFrom&) method

Effectue un cast statique sur les objets Exception.

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)
ParamètreDescription
TToType Exception cible.
TFromType Exception source.
ParamètreTypeDescription
objconst TFrom&Pointeur source.

ReturnValue

Résultat du cast si le cast est autorisé.

Deprecated

Conservé pour la compatibilité ascendante. Utilisez ExplicitCast à la place.

Voir aussi

System::StaticCast(const TFrom *) method

Spécialisation pour les types arithmétiques.

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

Voir aussi

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

Effectue un cast statique sur les objets SmartPtr.

template<typename TTo,typename TFrom> std::enable_if<!IsExceptionWrapper<TTo>::value, typenameCastResult<TTo>::type>::type System::StaticCast(SmartPtr<TFrom> const &obj)
ParamètreDescription
TToType du pointeur cible.
TFromType du pointeur source.
ParamètreTypeDescription
objSmartPtr<TFrom> const&Pointeur source.

ReturnValue

Résultat du cast si le cast est autorisé.

Deprecated

Conservé pour la compatibilité ascendante. Utilisez ExplicitCast à la place.

Voir aussi

System::StaticCast(SmartPtr<TFrom>) method

Effectue un cast statique sur les Objets vers des objets Exception.

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
ParamètreDescription
TToType Exception cible.
TFromtype Object.
ParamètreTypeDescription
objSmartPtr<TFrom>Pointeur source.

ReturnValue

Résultat du cast si le cast est autorisé.

Deprecated

Conservé pour la compatibilité ascendante. Utilisez ExplicitCast à la place.

Voir aussi

System::StaticCast(std::nullptr_t) method

Effectue un cast statique d’objets null.

template<typename TTo> CastResult<TTo>::type System::StaticCast(std::nullptr_t)
ParamètreDescription
TToType du pointeur cible.

ReturnValue

nullptr.

Deprecated

Conservé pour la compatibilité ascendante. Utilisez ExplicitCast à la place.

Voir aussi

System::StaticCast(TFrom) method

Spécialisation pour les types arithmétiques.

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

Voir aussi

System::StaticCast(TTo) method

Effectuer le cast de String vers String.

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

Voir aussi

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

Effectue un cast statique sur les objets WeakPtr.

template<typename TTo,typename TFrom> CastResult<TTo>::type System::StaticCast(WeakPtr<TFrom> const &obj)
ParamètreDescription
TToType du pointeur cible.
TFromType du pointeur source.
ParamètreTypeDescription
objWeakPtr<TFrom> const&Pointeur source.

ReturnValue

Résultat du cast si le cast est autorisé.

Deprecated

Conservé pour la compatibilité ascendante. Utilisez ExplicitCast à la place.

Voir aussi