Re: Static array initialisation

2021-03-31 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 17:27:44 UTC, DLearner wrote: Hi I did: immutable uint MemSize=100; // Memory size in bytes. // Memory Pool ubyte[MemSize] MemPool = 8; And had a look in memory. I think the compiler set up 101 '8's, not 100 in memory. Which I did not expect. Best rega

Re: Static array initialisation

2021-03-31 Thread russhy via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 17:54:38 UTC, DLearner wrote: On Wednesday, 31 March 2021 at 17:46:25 UTC, Imperatorn wrote: On Wednesday, 31 March 2021 at 17:27:44 UTC, DLearner wrote: Hi I did: immutable uint MemSize=100; // Memory size in bytes. // Memory Pool ubyte[MemSize] MemPoo

Re: why use string for this example of appender?

2021-03-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/31/21 5:32 PM, ludo wrote: Hi guys, I am working on an old software in D1, which defines at some point an array.d module. See my github file: https://tinyurl.com/5ffbmfvz If you go line 347, you see an ArrayBuilder struct, which is supposed to behave exactly like an array but with faste

Re: why use string for this example of appender?

2021-03-31 Thread ludo via Digitalmars-d-learn
Hi guys, I am working on an old software in D1, which defines at some point an array.d module. See my github file: https://tinyurl.com/5ffbmfvz If you go line 347, you see an ArrayBuilder struct, which is supposed to behave exactly like an array but with faster concatenation. The class comm

Re: Static array initialisation

2021-03-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/31/21 2:03 PM, DLearner wrote: On Wednesday, 31 March 2021 at 18:00:32 UTC, Steven Schveighoffer wrote: The answer is no, the compiler does not write to memory beyond the 100 elements. That memory *might* happen to have an 8 in there. That's not proof of anything though. I entirely agr

Re: Static array initialisation

2021-03-31 Thread DLearner via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 18:00:32 UTC, Steven Schveighoffer wrote: On 3/31/21 1:54 PM, DLearner wrote: On Wednesday, 31 March 2021 at 17:46:25 UTC, Imperatorn wrote: On Wednesday, 31 March 2021 at 17:27:44 UTC, DLearner wrote: Hi I did:    immutable uint  MemSize=100;  // Memory size in

Re: Static array initialisation

2021-03-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/31/21 1:54 PM, DLearner wrote: On Wednesday, 31 March 2021 at 17:46:25 UTC, Imperatorn wrote: On Wednesday, 31 March 2021 at 17:27:44 UTC, DLearner wrote: Hi I did:    immutable uint  MemSize=100;  // Memory size in bytes. // Memory Pool    ubyte[MemSize]  MemPool = 8; And had a look in

Re: Static array initialisation

2021-03-31 Thread DLearner via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 17:46:25 UTC, Imperatorn wrote: On Wednesday, 31 March 2021 at 17:27:44 UTC, DLearner wrote: Hi I did: immutable uint MemSize=100; // Memory size in bytes. // Memory Pool ubyte[MemSize] MemPool = 8; And had a look in memory. I think the compiler set up

Re: Static array initialisation

2021-03-31 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 17:27:44 UTC, DLearner wrote: Hi I did: immutable uint MemSize=100; // Memory size in bytes. // Memory Pool ubyte[MemSize] MemPool = 8; And had a look in memory. I think the compiler set up 101 '8's, not 100 in memory. Which I did not expect. Best rega

Static array initialisation

2021-03-31 Thread DLearner via Digitalmars-d-learn
Hi I did: immutable uint MemSize=100; // Memory size in bytes. // Memory Pool ubyte[MemSize] MemPool = 8; And had a look in memory. I think the compiler set up 101 '8's, not 100 in memory. Which I did not expect. Best regards

How use WinUI with Dlang?

2021-03-31 Thread Marcone via Digitalmars-d-learn
There is a way for create modern windows GUI with WinUI and Dlang?

Re: Derived type

2021-03-31 Thread novice3 via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 12:09:33 UTC, Basile B. wrote: yeah template instances are identified using the parameters identifiers, then the alias is just a syntactic shortcut to that, not producing a new symbol with a unique mangle... so, no way to generate struct with parametrized name by

Re: Derived type

2021-03-31 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 31 March 2021 at 04:49:50 UTC, novice3 wrote: On Tuesday, 30 March 2021 at 21:53:34 UTC, Basile B. wrote: struct Typedef(TBase) { TBase payload; alias payload this; } alias Xobj = Typedef!(void*); This is how std.typecons.Typedef made, IMHO. The problem is this code gener

Re: Contributing CDF bindings to Deimos

2021-03-31 Thread Jacob Carlborg via Digitalmars-d-learn
On 2021-03-25 05:00, Chris Piker wrote: I've attempted to follow all guidelines as best I understood them, but this is my first package.  It likely has some style and functionality issues. There's a general convention to name the top level module or package the same as the project. To avoid