System::Nullable class

Nullable class

Forward declaration.

template<typename T>class Nullable
ParameterDescription
TThe underlying value type which is extended by the Nullable class

Methods

MethodDescription
Equals(const T1&) constDetermines if the value represented by the current object is equal to the value represented by the specified Nullable object.
get_HasValue() constDetermines whether the current object represents any value.
get_Value() constReturns a copy of the value represented by the current object.
GetHashCode() constReturns a hash code for the current object.
GetValueOrDefault(T)Returns the value represented by the current object or the specified value if the value represented by the current object is null.
GetValueOrDefault()
IsNull() constDetermines if the current object represents a null-value.
Nullable()Constructs an instance that represents null-value.
Nullable(std::nullptr_t)Constructs an instance that represents null.
Nullable(const T1&)Constructs an instance of Nullable class that represents the specified value converted (if necessary) to the value of the underlying type T.
Nullable(const Nullable<T1>&)Constructs an instance that represents a value that is represented by the specified Nullable object. The specified nullable object may represent a value of different type than the underlying type of the constructed instance in which case the represented value is converted to a value of type T.
NullableBoolHelper(const T1&, const std::function<bool()>&, bool) constHelper function to check if this and other are both not nulls and call a lambda if so. Used in implementation.s.
operator const T &() constReturns a constant reference to the value represented by the current object.
operator!=(std::nullptr_t) constDetermines if the value represented by the current object is not null.
operator!=(const T1&) constDetermines if the value represented by the current object is not equal to the specified value.
operator!=(const Nullable<T1>&) constDetermines if the value represented by the current object is not equal to the value represented by the specified Nullable object.
operator&=(bool)Applies operator&=() to the value represented by the current object using the specified value as a right-side argument.
operator+(std::nullptr_t) constReturns a default constructed instance of Nullable class.
operator+(const T1&) constSums nullable and non-nullable values.
operator+(const Nullable<T1>&) constSums nullable values.
operator+=(std::nullptr_t)Resets the current object so that it represents a null-value.
operator+=(const T1&)Applies operator+=() to the value represented by the current object using the specified value as a right-side argument.
operator+=(const Nullable<T1>&)Applies operator+=() to the value represented by the current object using the value represented by the specified Nullable object as the right-side argument.
operator-(T1) constSubtracts nullable and null-pointed values.
operator-(const T1&) constSubtracts nullable and non-nullable values.
operator-(const Nullable<T1>&) constSubtracts nullable values.
operator-=(T1)Returns an instance of Nullable class that represents a null-value.
operator-=(const T1&)Applies operator-=() to the value represented by the current object using the specified value as a right-side argument.
operator-=(const Nullable<T1>&)Applies operator-=() to the value represented by the current object using the value represented by the specified Nullable object as the right-side argument.
operator<(std::nullptr_t) constAlways returns false.
operator<(const T1&) constDetermines if the value represented by the current object is less than the specified value by applying operator<() to these values.
operator<(const Nullable<T1>&) constDetermines if the value represented by the current object is less than the value represented by the specified Nullable object by applying operator<() to these values.
operator<=(std::nullptr_t) constAlways returns false.
operator<=(const T1&) constDetermines if the value represented by the current object is less or equal to the specified value by applying operator<=() to these values.
operator<=(const Nullable<T1>&) constDetermines if the value represented by the current object is less or equal to the value represented by the specified Nullable object by applying operator<=() to these values.
operator=(std::nullptr_t)Assigns a null to the current object.
operator=(const T1&)Replaces the object’s currently represented value with the specified one.
operator=(const Nullable<T1>&)Replaces the object’s currently represented value with the specified one.
operator==(std::nullptr_t) constDetermines if the value represented by the current object is null.
operator==(const T1&) constDetermines if the value represented by the current object is equal to the specified value.
operator==(const Nullable<T1>&) constDetermines if the value represented by the current object is equal to the value represented by the specified Nullable object.
operator>(std::nullptr_t) constAlways returns false.
operator>(const T1&) constDetermines if the value represented by the current object is greater than the specified value by applying operator>() to these values.
operator>(const Nullable<T1>&) constDetermines if the value represented by the current object is greater than the value represented by the specified Nullable object by applying operator>() to these values.
operator>=(std::nullptr_t) constAlways returns false.
operator>=(const T1&) constDetermines if the value represented by the current object is greater or equal to the value represented by the specified object by applying operator>=() to these values.
operator>=(const Nullable<T1>&) constDetermines if the value represented by the current object is greater or equal to the value represented by the specified Nullable object by applying operator>=() to these values.
[operator=](./operator_=/)(bool)
reset()Sets the currently represented value to null.
ToString() constConverts the value represented by the current object to string.

Typedefs

TypedefDescription
ValueTypeAn alias for a type of the value represented by this class.

Remarks

Represents a value of the specified type that can be assigned null. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

See Also