Re: Where I download Digital Mars C Preprocessor sppn.exe?

2022-04-02 Thread rikki cattermole via Digitalmars-d-learn
What on earth are you talking about. ImportC is highly experimental and was announced far too soon. If you look at the last release a very large number of the bug fixes were for ImportC specifically. https://dlang.org/changelog/2.099.0.html#bugfix-list

Re: Where I download Digital Mars C Preprocessor sppn.exe?

2022-04-02 Thread Marcone via Digitalmars-d-learn
ImportC is deprecated as everything in D is deprecated and abandoned. No link works, every download link is broken as no one cares. All D code is always full of bugs and needs to be corrected by the user before trying to run it, in order to realize that it wasted time.

Where I download Digital Mars C Preprocessor sppn.exe?

2022-04-02 Thread Marcone via Digitalmars-d-learn
Where I download Digital Mars C Preprocessor sppn.exe? I need it to use ImportC

Variadic templates with default parameters.

2022-04-02 Thread JG via Digitalmars-d-learn
Consider the following code: ```d import std; auto logVariadic(T...)(T x,int line=__LINE__,string file=__FILE__) { writeln(file,":",line," ",x); } int variadicCnt; auto logVariadicWrapper(T...)(T x, int line=__LINE__, string file=__FILE__) { variadicCnt++; logVariadic(x,line,file); }

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Paul Backus via Digitalmars-d-learn
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:

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
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

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread vit via Digitalmars-d-learn
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:

Re: Unit tests via DUB

2022-04-02 Thread Alexander Zhirov via Digitalmars-d-learn
On Saturday, 2 April 2022 at 14:35:49 UTC, Salih Dincer wrote: On Saturday, 2 April 2022 at 13:31:47 UTC, Alexander Zhirov wrote: On Saturday, 2 April 2022 at 13:12:04 UTC, Salih Dincer wrote: On Saturday, 2 April 2022 at 11:53:12 UTC, alexanderzhirov wrote: I don't quite understand why

Re: Unit tests via DUB

2022-04-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/2/22 7:53 AM, alexanderzhirov wrote: I don't quite understand why compiling unit tests using DUB doesn't work. JSON: ```json {   "authors": [     "alexander"   ],   "description": "Array Slicing",   "license": "proprietary",   "name": "array_slicing",   "targetName": "program",  

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Vijay Nayar via Digitalmars-d-learn
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

Re: Unit tests via DUB

2022-04-02 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 2 April 2022 at 13:31:47 UTC, Alexander Zhirov wrote: On Saturday, 2 April 2022 at 13:12:04 UTC, Salih Dincer wrote: On Saturday, 2 April 2022 at 11:53:12 UTC, alexanderzhirov wrote: I don't quite understand why compiling unit tests using DUB doesn't work. Source code? A

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Vijay Nayar via Digitalmars-d-learn
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

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Vijay Nayar via Digitalmars-d-learn
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.

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Salih Dincer via Digitalmars-d-learn
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: )

Re: Unit tests via DUB

2022-04-02 Thread Alexander Zhirov via Digitalmars-d-learn
On Saturday, 2 April 2022 at 13:12:04 UTC, Salih Dincer wrote: On Saturday, 2 April 2022 at 11:53:12 UTC, alexanderzhirov wrote: I don't quite understand why compiling unit tests using DUB doesn't work. Source code? A common example from a textbook ```d import std.array; bool

Re: Unit tests via DUB

2022-04-02 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 2 April 2022 at 11:53:12 UTC, alexanderzhirov wrote: I don't quite understand why compiling unit tests using DUB doesn't work. Source code?

Google Code Jam 2022

2022-04-02 Thread Siarhei Siamashka via Digitalmars-d-learn
Hello, The Google Code Jam 2022 qualification round has started and it's a good opportunity to practice programming language skills. I wonder if there will be many nice and clean solutions submitted in D language? We can discuss them after the contest.

Unit tests via DUB

2022-04-02 Thread alexanderzhirov via Digitalmars-d-learn
I don't quite understand why compiling unit tests using DUB doesn't work. JSON: ```json { "authors": [ "alexander" ], "description": "Array Slicing", "license": "proprietary", "name": "array_slicing", "targetName": "program", "targetPath": "bin" } ``` Projects structure: ```sh

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread Vijay Nayar via Digitalmars-d-learn
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

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread vit via Digitalmars-d-learn
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

Re: Can std.variant be used with std.container.rbtree?

2022-04-02 Thread JG via Digitalmars-d-learn
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