On Monday, 23 November 2020 at 01:24:54 UTC, Max Haughton wrote:
If you want to keep things simple, use OOP (classes).
If you need to use structs, the "sumtype" may be just what you
need (it's a bit more lightweight than std.algebraic in the
standard library). If you want to implement this
On Monday, 23 November 2020 at 01:20:04 UTC, data pulverizer
wrote:
Hi all,
I am trying to construct a tree data structure composed of
differently (statically) typed nodes. The basic case is a
binary tree. So you have a node like:
```
struct Node(T)
{
T value;
Node* next;
Node* prev;
On Monday, 23 November 2020 at 01:20:04 UTC, data pulverizer
wrote:
Hi all,
I am trying to construct a tree data structure composed of
differently (statically) typed nodes. The basic case is a
binary tree. So you have a node like:
```
struct Node(T)
{
T value;
Node* next;
Node* prev;
Hi all,
I am trying to construct a tree data structure composed of
differently (statically) typed nodes. The basic case is a binary
tree. So you have a node like:
```
struct Node(T)
{
T value;
Node* next;
Node* prev;
}
void main()
{
auto x = Node!(int)(2);
auto y =