UnboxRef()

System::Text::Json::Serialization::Metadata::UnboxRef(const SmartPtr<Object>&) function

Unboxes a boxed value type to a mutable reference allowing in-place modification of the boxed value. Supports both BoxedValue<T> wrappers and raw T instances.

template<class T> std::enable_if<!std::is_enum<T>::value &&IsBoxable<T>::value &&std::is_base_of<Object, T>::value, T &>::type System::Text::Json::Serialization::Metadata::UnboxRef(const SmartPtr<Object> &obj)

Template parameters

ParameterDescription
TValue type derived from Object.

Arguments

ParameterTypeDescription
objconst SmartPtr<Object>&Object to unbox.

Return Value

Mutable reference to the stored value.

Exceptions

ExceptionDescription
System::NullReferenceExceptionIs thrown when obj is empty.
System::InvalidCastExceptionIs thrown when obj does not represent the specified value type.

System::Text::Json::Serialization::Metadata::UnboxRef(const SmartPtr<Object>&) function

Unboxes a boxed value type to a mutable reference allowing in-place modification of the boxed value. Supports BoxedValue<T> wrappers only, for value types not derived from Object.

template<class T> std::enable_if<!std::is_enum<T>::value &&IsBoxable<T>::value &&!std::is_base_of<Object, T>::value, T &>::type System::Text::Json::Serialization::Metadata::UnboxRef(const SmartPtr<Object> &obj)

Template parameters

ParameterDescription
TValue type not derived from Object.

Arguments

ParameterTypeDescription
objconst SmartPtr<Object>&Object to unbox.

Return Value

Mutable reference to the stored value.

Exceptions

ExceptionDescription
System::NullReferenceExceptionIs thrown when obj is empty.
System::InvalidCastExceptionIs thrown when obj does not represent the specified value type.

See Also