I had to write this recently
void reset()
{
state.end_index = 0;
state.buffer_list = SinglyLinkedList!(ubyte[])();
}
While not that bad, it's annoying, why can't we do like like: A a = {}
?
void reset()
{
state.end_index = 0;
state.buffer_list = {};
}
It is much easier to read, i do not use constructors or RAII, and i feel like i'm being penalized because i want to keep things simple
Could it be allowed for cases where there are no constructors? i don't know the rules about them, but if one is automatically generated, maybe check for @disable
d
Maybe it could be a syntax sugar for state.buffer_list = state.buffer_list.init
Even though i also hate .init
because just like destroy
they are already used in druntime and therefore i can't use them myself.. i hate rules like that
Quality of life for people who only live with structs, please!