Re: Iteratable single linked list of floats.

2021-04-23 Thread Alain De Vos via Digitalmars-d-learn
Here a working code, ``` import std.stdio; void main(){ struct List { struct Node { float f; Node *next=null; } Node * root=null; bool empty() const {return !root;} void popFront() {root=root.next;} float front() const

Re: Iteratable single linked list of floats.

2021-04-21 Thread drug via Digitalmars-d-learn
21.04.2021 16:19, Alain De Vos пишет: import std.stdio; void main(){ struct List {     struct Node {     float f;     Node *next;     }     Node * root=null;     bool empty() const {return !root;}     void popFront() {root=root.next;}     f

Re: Iteratable single linked list of floats.

2021-04-21 Thread Alain De Vos via Digitalmars-d-learn
Formatted , ``` import std.stdio; void main(){ struct List { struct Node { float f; Node *next; } Node * root=null; bool empty() const {return !root;} voi