std::comptime
Functions
fn TypeOf(TYPE || EXPRESSION): comptimeTypeInfo
Returns compile-time type information. Cannot assign to memory, just available in compile-time. The expression is evaluated to determine type in compile-time and will not executed at runtime.
fn Range(EXPR): comptimeRange
Returns compile-time wrapper for compile-time iterations. Supports only iterable compile-time expressions.
Structures
struct comptimeRange
Private compile-time wrapper for compile-time iterations.
struct comptimeTypeInfos {}
Private compile-time information wrapper for type infos. Supports iterable implementations. Using with built-in len function returns count of fields as constant expression.
struct comptimeTypeInfo
Private compile-time type information wrapper.
Methods:
fn Kind(self): Kind
Returns Kind of type. Returns as constant expression.
fn Str(self): str
Returns string value of type. Returns as constant expression.
fn Bits(self): int
Returns bitsize of type. Supports only primitive integer and floating-point types. Returns as constant expression.
fn Elem(self): comptimeTypeInfo
Returns comptimeTypeInfo for element type. Supports only pointers (except unsafe pointer), smart pointers, arrays, slices and enums.
fn Size(self): int
Returns size of array. Returns as constant expression. Returns zero if array type is auto-sized declaration.
fn Key(self): comptimeTypeInfo
Returns type information for key type. Supports only map types.
fn Value(self): comptimeTypeInfo
Returns type information for value type. Supports only map types.
fn Fields(self): comptimeStructFields | comptimeEnumFields
Returns field informations for type. Supports only structure and enum types. Using with built-in len function returns count of fields as constant expression.
fn Params(self): comptimeParams
Returns parameter information for function's parameters. Supports only function types.
fn Types(self): comptimeTypeInfos
Returns comptime-type information datas for tuple types. Supports only tuple types.
fn Result(self): comptimeTypeInfo
Returns compile-time information data for result type of function. Only supports function types.
fn Public(self): bool
Reports whether type is public as constant expression. Supports only structures, enums, type enums, and traits.
fn Binded(self): bool
Reports whether type is binded as constant expression.
fn Ordered(self): bool
Reports whether kind supports ordered constrait as constant expression.
fn Comparable(self): bool
Reports whether kind supports comparable constrait as constant expression.
fn Mutable(self): bool
Reports whether kind is mutable as constant expression.
fn Exceptional(self): bool
Reports whether function type is exceptional as constant expression. Only supports function types.
struct comptileStructFields
Private compile-time information wrapper for struct fields. Supports iterable implementations. Using with built-in len function returns count of fields as constant expression.
struct comptileStructaField
Private compile-time struct field information wrapper.
Methods:
fn Name(self): str
Returns name of field. Returns as constant expression.
fn Public(self): bool
Reports whether field is public as constant expression.
fn Type(self): comptimeTypeInfo
Returns type information for field.
struct comptileEnumFields
Private compile-time information wrapper for enum fields. Supports iterable implementations. Using with built-in len function returns count of fields as constant expression.
struct comptileEnumField
Private compile-time enum field information wrapper.
Methods:
fn Name(self): str
Returns name of field. Returns as constant expression.
struct comptimeParams
Private compile-time information wrapper for function parameters. Supports iterable implementations. Using with built-in len function returns count of fields as constant expression.
struct comptimeParam
Private compile-time function parameter information wrapper.
Methods:
fn Name(self): str
Returns name of parameter. Returns as constant expression.
fn Variadic(self): bool
Reports whether parameter is variadic as constant expression.
fn Reference(self): bool
Reports whether parameter is reference as constant expression.
fn Type(self): comptimeTypeInfo
Returns type information for parameter.
Enums
enum Kind
Type kinds.
Fields:
Void
: VoidInt
: intUint
: uintUintptr
: uintptrI8
: i8I16
: i16I32
: i32I64
: i64U8
: u8U16
: u16U32
: u32U64
: u64F32
: f32F64
: f64Str
: strBool
: boolAny
: anyArray
: ArraySlice
: SliceMap
: MapStruct
: StructureTrait
: TraitEnum
: EnumPtr
: Raw pointerUnsafePtr
: Unsafe raw pointerRef
: Smart pointerFunc
: FunctionTuple
: Tuple