betterc.cppclass

Betterc: Frequently used primitives suitable for use in the BetterC D subset. inspired by https://theartofmachinery.com/2018/05/27/cpp_classes_in_betterc.html

Members

Functions

cdelete
void cdelete(T instance)

Calls the destructor of a previously malloc'd class and frees its memory

cnew
T cnew(Args args)

Creates an instance of T inside the malloc'd memory and calls its constructor.

Variables

isDestructable
enum bool isDestructable(T);

Returns true if T is destructible with T.destructor() method. In other words tests whether T contains void destructor() method. Please note: the parent destructor must be called explicitly.

Meta

Authors

Maxim Freck <maxim@freck.pp.ru>