Menu

operators-can-be-null

Will Pittenger

Not really an operator. The ? psuedo-operator is actually a type modifier that forces a primitive type to allow the null value. It can be part of a [typealias]. List it just before the rest of the type descriptor. Not valid on reference types. If you need to combine it with ref type modifier keyword, place the ? type modifier into an typealias and the ref type modifier keyword outside the typealias. ? can be applied to expression variables, but not data members that are const, but not var.

Usage

(\var\ [\const\] | \expression\) \?\ /RestOfTypeDescriptor/ /identifier/

For more on what /RestOfTypeDescriptor/ can be, see Type descriptors.


Related

Wiki: Appendices-Terms-Type descriptors
Wiki: Operators
Wiki: keywords-const
Wiki: keywords-expression
Wiki: keywords-null
Wiki: keywords-ref
Wiki: keywords-typealias
Wiki: keywords-var