Skip to content

Rtti Rt

Spice
import "std/runtime/rtti_rt";

TypeInfo struct

TypeInfo is a type that contains the name of a type. It is used to identify types at runtime and is part of the RTTI.

Constructors

ctor

Spice
public p TypeInfo.ctor(string name)

Construct a type info holding the given type name

Parameters

Name Type Description
name string Name of the type

Methods

getName

Spice
public f<string> TypeInfo.getName()

Retrieve the name of the type

Returns: string — Name of the type

Operators

operator==

Spice
public f<bool> operator==(const TypeInfo& a, const TypeInfo& b)

Check if two type infos refer to the same type, i.e. they have the same name

Parameters

Name Type Description
a const TypeInfo&
b const TypeInfo&

Returns: bool — Equal or not equal

operator!=

Spice
public f<bool> operator!=(const TypeInfo& a, const TypeInfo& b)

Check if two type infos refer to different types

Parameters

Name Type Description
a const TypeInfo&
b const TypeInfo&

Returns: bool — Not equal or equal