On Saturday, 2 April 2022 at 14:49:15 UTC, Vijay Nayar wrote:
On Saturday, 2 April 2022 at 14:35:10 UTC, Vijay Nayar wrote:
The `tryMatch` method fails to compile, and instead I get the
following error:
```d
/dlang/dmd/linux/bin64/../../src/phobos/std/sumtype.d(2004):
Error: static assert: "`
On 4/1/22 6:22 PM, Vijay Nayar wrote:
Consider the following program:
```d
void main()
{
import std.stdio;
import std.container.rbtree;
import std.variant;
// alias Type = int; // Works with no problem.
alias Type = Variant; // Produces error.
auto rbTree = new RedBlackTree!(
On Saturday, 2 April 2022 at 14:49:15 UTC, Vijay Nayar wrote:
On Saturday, 2 April 2022 at 14:35:10 UTC, Vijay Nayar wrote:
The `tryMatch` method fails to compile, and instead I get the
following error:
```d
/dlang/dmd/linux/bin64/../../src/phobos/std/sumtype.d(2004):
Error: static assert: "`
On Saturday, 2 April 2022 at 14:35:10 UTC, Vijay Nayar wrote:
The `tryMatch` method fails to compile, and instead I get the
following error:
```d
/dlang/dmd/linux/bin64/../../src/phobos/std/sumtype.d(2004):
Error: static assert: "`handlers[0]` of type `int function(ref
ubyte[] _1, ref ubyte[]
On Saturday, 2 April 2022 at 10:04:49 UTC, vit wrote:
Try use ```std.sumtype```.
I'm playing with SumType to see how it works, and I must be doing
something silly, because it fails to compile with the first
example type I attempted. Consider the following:
```d
import std.sumtype;
import st
On Saturday, 2 April 2022 at 14:23:31 UTC, Salih Dincer wrote:
If your type includes opCmp() there is no reason not to use
rbTree.
I am using rbTree, the problem is when I try to use it with
Variant, at which point it blows up.
On Friday, 1 April 2022 at 22:22:21 UTC, Vijay Nayar wrote:
A `RedBlackTree` constructs and runs perfectly fine using "int"
as the data type, but it seems to blow up as soon as I use
`std.variant : Variant`.
```
Compilation output (1: )
/dlang/dmd/linux/bin64/../../src/phobos/std/container/
On Saturday, 2 April 2022 at 10:03:19 UTC, JG wrote:
You need an order on the elements in a red black tree. Am I
correct in thinking you want a container of the form given a
key (a string) recover some data (of different types). If so
make the elements you store in the red black tree tuples (k,
On Friday, 1 April 2022 at 22:22:21 UTC, Vijay Nayar wrote:
Consider the following program:
```d
void main()
{
import std.stdio;
import std.container.rbtree;
import std.variant;
[...]
Variant can contain any type => variant cannot assume attributes
like pure nothrow @safe @nogc o
On Friday, 1 April 2022 at 22:22:21 UTC, Vijay Nayar wrote:
Consider the following program:
```d
void main()
{
import std.stdio;
import std.container.rbtree;
import std.variant;
[...]
You need an order on the elements in a red black tree. Am I
correct in thinking you want a conta
Consider the following program:
```d
void main()
{
import std.stdio;
import std.container.rbtree;
import std.variant;
// alias Type = int; // Works with no problem.
alias Type = Variant; // Produces error.
auto rbTree = new RedBlackTree!(Type);
rbTree.stable
11 matches
Mail list logo