Menu

keywords-get

Will Pittenger

Used to declare one of two possible property accessors that a property can have. (The other is the set accessor.) get accessors either return the value in a data member or compute a value to return. (A "computation" might be a simple type-cast.) get accessors are implicitly const. A get accessor always returns the same type that the property was declared as.

(\public\ | \protected\ | \private\) {[\static\] | [\virtual\] | [\final\] | [\abstract\]} \property\ /TypeDescriptor/ /identifier/
  [{[\virtual\] | [\final\] | [\abstract\]} \get\
    ' Return some value
  ]

  [{[\virtual\] | [\final\] | [\abstract\]} \set\
    ' Store the value in \value\ somewhere
  ]

Neither properties and property accessors can't be declared with both the virtual and abstract keywords. For more on what /TypeDescriptor/ can be, see Type descriptors.


Related

Wiki: Appendices-Terms-r-value
Wiki: Keywords
Wiki: When is it a procedure, command, function, property, property accessor, method, complex statement, or type cast?
Wiki: keywords-abstract
Wiki: keywords-const
Wiki: keywords-final
Wiki: keywords-property
Wiki: keywords-return
Wiki: keywords-set
Wiki: keywords-static
Wiki: keywords-virtual