11.14. Type trait macros

The TYPE_TRAITS module provides compile-time type introspection and manipulation. It includes type queries (is_numeric, is_string, is_pointer), type transformations, and generic programming utilities for writing type-aware macros and functions.

All functions and symbols are in “type_traits” module, use require to get access to it.

require daslib/type_traits

11.14.1. Call macros

type_traits.is_subclass_of

Converts to ‘true’ if the first type is a subclass of the second type.

11.14.2. Typeinfo macros

type_traits.safe_has_property

this macro implements “has_property” type trait, which returns true when structure has a property

type_traits.fields_count

this macro implements “fields_count” type trait, which returns total number of fields in the structure