Re: std.zlib odd behavior

2019-03-05 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 01:43:42 UTC, solidstate1991 wrote: https://github.com/ZILtoid1991/dimage/blob/master/source/dimage/png.d It seems that after a certain point, it doesn't add more data to the compression stream, flushing doesn't help. What do you mean by "doesn't add"? ubyte[]

Re: InsertBefore in DList of structs

2019-03-05 Thread drug via Digitalmars-d-learn
On 05.03.2019 2:01, r-const-dev wrote: Thanks, seems that using dataPoints[] makes dataPoints usable as an range. How can I learn more about [] operator? I'm not sure I understand how is this documented in DList. dataPoints is an aggregate type variable, not a range and slice operator

Re: InsertBefore in DList of structs

2019-03-05 Thread r-const-dev via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 08:39:56 UTC, drug wrote: On 05.03.2019 2:01, r-const-dev wrote: [...] dataPoints is an aggregate type variable, not a range and slice operator opSlice/[] returns a range of this aggregate type. I have no appropriate links unfortunately but these can be useful

Re: DUB / compiling same source and config to different windows subsystems in 32/64 bit

2019-03-05 Thread evilrat via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 05:03:42 UTC, Mike Parker wrote: This has nothing to do with dub, so that’s the wrong place for it. The dmd for windows docs needs to make clear the distinction between the linkers and the differences in behavior, and point to the linked docs for options. I just

Re: precise GC

2019-03-05 Thread Rainer Schuetze via Digitalmars-d-learn
On 04/03/2019 12:12, KnightMare wrote: > For example, we have some rooted memory block as > auto rooted = new long[1_000_000]; > 1) conservative-GC will scan it for false pointers every GC-cycle. is it > true? > 2) precise-GC will NOT scan it at all. is it true? As Adam pointed out, this

Re: Help with Regular Expressions (std.regex)

2019-03-05 Thread Samir via Digitalmars-d-learn
On Monday, 4 March 2019 at 18:57:34 UTC, dwdv wrote: There is also std.file.slurp which makes this quite easy: slurp!(int, int, int, int, int)("03.input", "#%d @ %d,%d: %dx%d"); That's brilliant! This language just keeps putting a smile on my face every time I learn something new like this!

Re: precise GC

2019-03-05 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 05, 2019 at 09:50:34PM +0100, Rainer Schuetze via Digitalmars-d-learn wrote: > On 04/03/2019 12:12, KnightMare wrote: [...] > > 3) closures: do the closures have any internal types that helps to > > GC or are they (full closure memory block) scanned as in the > > conservative mode? >

Re: precise GC

2019-03-05 Thread Rainer Schuetze via Digitalmars-d-learn
On 05/03/2019 22:30, H. S. Teoh wrote: > On Tue, Mar 05, 2019 at 09:50:34PM +0100, Rainer Schuetze via > Digitalmars-d-learn wrote: >> On 04/03/2019 12:12, KnightMare wrote: > [...] >>> 3) closures: do the closures have any internal types that helps to >>> GC or are they (full closure memory

Re: default construction is disabled for type

2019-03-05 Thread Machine Code via Digitalmars-d-learn
public this() { } Doesn't change anything...

Re: std.zlib odd behavior

2019-03-05 Thread solidstate1991 via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 02:19:26 UTC, Adam D. Ruppe wrote: I haven't found the bug in your code yet, but one thing I suspect from my experience is you might be reusing a buffer. std.zlib actually stores pointers internally across function calls, so if you are trying to compress a stream,

Re: default construction is disabled for type

2019-03-05 Thread Machine Code via Digitalmars-d-learn
So I find out the issue: it was due a struct member of the class having @disable this();

default construction is disabled for type

2019-03-05 Thread Machine Code via Digitalmars-d-learn
What's that error? below code used to work fine, now it gives this compiler error. class Keyword { this(string value, Token type) { this.value = value; this.type = type; } string value; Token type; Keyword next; }