On Tuesday, 25 June 2024 at 06:44:28 UTC, Salih Dincer wrote:
I'm not sharing the code for now because
it's a challenge.
Since we couldn't get a code snippet, I'd like to share some
framing code without answers:
```d
struct SumPrimes(size_t size)
{
import std.bigint;
auto next = BigInt
Hello all. In my application I came across a desire to store an
ordered array of handles that could point to one of several
different objects, and it seems like the tool I want for that is
SumType.
I started with something like (simplified of course):
```d
class Foo {}
class Bar {}
alias Ite
import std.container : RedBlackTree;
int main()
{
struct Location {
int x;
int y;
}
struct Node{
this(Location loc, uint f) {
this.loc = loc;
this.f = f;
}
Location loc;
uint f;
}
auto priorityQueue = new R
On Thu, Jun 27, 2024 at 08:56:13PM +, WhatMeWorry` via Digitalmars-d-learn
wrote:
> import std.container : RedBlackTree;
>
> int main()
> {
>
> struct Location {
> int x;
> int y;
> }
>
> struct Node{
> this(Location loc, uint f) {
> this.loc
Thanks, that did the trick. Not sure why having the declarations
at global scope (or is it module scope in D) would work versus
having them at local scope?
On Thu, Jun 27, 2024 at 10:14:06PM +, WhatMeWorry via Digitalmars-d-learn
wrote:
> Thanks, that did the trick. Not sure why having the declarations at
> global scope (or is it module scope in D) would work versus having
> them at local scope?
If you stuck 'static' to the local scope declarati