There was an error while loading. Please reload this page.
typenameof can be used to get the name of a compile-time type as a C-String.
typenameof
typenameof Type
The resulting value will be a *ubyte null-terminated string.
*ubyte
import basics struct Thing () func main { thing *Thing = null printNameOfType(thing) } func printNameOfType(_something *$T) { printf("You passed a pointer to %s\n", typenameof $T) }
You passed a pointer to Thing
As opposed to older methods of using RTTI for the same effect, the usage of typenameof does not require runtime type information to be enabled.
Table of Contents