Class: Object
Lua
C++
Edit

Object:As

This method casts the object to a derived type.


Syntax

function As<T>()

Parameter

Returns

Returns the object as a derived type T, or nil if the object cannot be cast to the specified type.


Remarks

This method should never be called in a class constructor or destructor.


Example

-- Cast to base type
local o = CreateBuffer()

-- Cast to derived type
local buffer = o:As<Buffer>()
Copyright © 2024 Ultra Software.
All rights reserved.