On Monday, 27 August 2018 at 11:52:02 UTC, Andrey wrote:
Hello again,
I have this part of code:
...
if(index + 3 >= data.length || data[index + 1][0] == '&' ||
data[index + 2][0] == '&' || data[index + 3][0] == '&' ||
data[index + 4][0] == '&')
{
writeln("Some text...");
}
I don't want
On Sunday, 5 August 2018 at 20:57:32 UTC, aliak wrote:
On Sunday, 5 August 2018 at 20:10:49 UTC, Kamil Koczurek wrote:
Is there a way to keep track of objects without owning them?
That is, could I have a smart pointer that behaves somewhat
like this:
WeakPtr!Class wptr = getSomeInstance();
Is there a way to keep track of objects without owning them? That
is, could I have a smart pointer that behaves somewhat like this:
WeakPtr!Class wptr = getSomeInstance();
auto obj = wptr.peek; //[1]
if(obj !is null) {
obj.stuff();
}
[1]: If wptr points to something that is still reachable
I recently wrote a brainfuck compiler in D, which loads the BF
source at compile time, performs some (simple) optimizations,
translates everything to D and puts it into the source code with
a mixin.
I did manage to get some pretty good performance, but for some
programs in brainfuck I have
On Friday, 15 June 2018 at 14:57:33 UTC, Adam D. Ruppe wrote:
You can make the tree store a *pointer* to a tree though.
That's the traditional way to do it and it works here too.
Oh, alright. I changed Tree to be a class instead of a struct and
it seems to work just fine now. Thanks a lot!
Hi,
I'm trying to implement a simple tree and this 3-liner was my
initial idea:
struct Tree(T) {
Algebraic!(Tree, T)[] content;
}
But it doesn't work and I get the following error message:
/.../variant.d(...): Error: struct `app.Tree` no size because of
forward reference