Re: Alias woes

2020-12-18 Thread SealabJaster via Digitalmars-d-learn
On Thursday, 17 December 2020 at 22:06:00 UTC, SealabJaster wrote: ... Well, at least I understand why the context pointer exists now. If you were to add a `pragma(msg, __FUNCTION__)` into either of the templated functions, you'd get the following output. ``` example.C.doShizz!(a).doShizz e

Re: Simple BeamUI project won't link

2020-12-18 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 18 December 2020 at 19:15:16 UTC, Daren Scot Wilson wrote: On Wednesday, 16 December 2020 at 07:45:50 UTC, Ferhat Kurtulmuş wrote: On Wednesday, 16 December 2020 at 07:40:45 UTC, Ferhat Kurtulmuş wrote: This may be not your issue, but I could manage it to work by adding this line:

Re: Simple BeamUI project won't link

2020-12-18 Thread Daren Scot Wilson via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 07:45:50 UTC, Ferhat Kurtulmuş wrote: On Wednesday, 16 December 2020 at 07:40:45 UTC, Ferhat Kurtulmuş wrote: This may be not your issue, but I could manage it to work by adding this line: subPackage "examples/myproject" to the dub.sdl of the beamui. I simp

Re: Simple BeamUI project won't link

2020-12-18 Thread Daren Scot Wilson via Digitalmars-d-learn
On Wednesday, 16 December 2020 at 07:40:45 UTC, Ferhat Kurtulmuş wrote: On Wednesday, 16 December 2020 at 07:02:11 UTC, Daren Scot Wilson wrote: Trying out the beamui GUI package, obtained by git clone from github. The "basic" example builds and runs. I'm working on an Arch Linux machine with

Re: Floating point values in structs.

2020-12-18 Thread Dave P. via Digitalmars-d-learn
On Friday, 18 December 2020 at 16:23:20 UTC, Adam D. Ruppe wrote: On Friday, 18 December 2020 at 16:18:12 UTC, Dave P. wrote: Is the proper solution to change the struct definition to: yeah that's the best option right now A bit of a pain when porting, but alright. I find the setting flo

Re: UFCS functions with both pointers and refs

2020-12-18 Thread Marcone via Digitalmars-d-learn
Two differents types; Foo type and pointer type. Need function overload foe each or just use ref and avoid pointer.

Re: LDC relocation flags

2020-12-18 Thread Johan Engelen via Digitalmars-d-learn
On Friday, 18 December 2020 at 13:00:45 UTC, Severin Teona wrote: Hi guys! Do you know how can I compile D code using LDC with the following gcc flags? * -msingle-pic-base * -mpic-register=r9 * -mno-pic-data-is-text-relative. As far as I know, there are no equivalents in D for these. Is is o

Re: Floating point values in structs.

2020-12-18 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 18 December 2020 at 16:18:12 UTC, Dave P. wrote: Is the proper solution to change the struct definition to: yeah that's the best option right now I find the setting floats to nan pretty bizarre. yeah i wrote about it here not long ago http://dpldocs.info/this-week-in-d/Blog.Post

Floating point values in structs.

2020-12-18 Thread Dave P. via Digitalmars-d-learn
I got burned by behavior of struct initialization I didn’t anticipate last night. Consider a struct: struct Foo { float x, y, z; int a, b, c; } My source C code was initializing it by doing something like: Foo f = {.y = 3} Which uses the C behavior that all the other fields will be s

LDC relocation flags

2020-12-18 Thread Severin Teona via Digitalmars-d-learn
Hi guys! Do you know how can I compile D code using LDC with the following gcc flags? * -msingle-pic-base * -mpic-register=r9 * -mno-pic-data-is-text-relative. As far as I know, there are no equivalents in D for these. Is is ok to use the -Xcc flag? Thank you!

Re: Avoid deallocate empty arrays?

2020-12-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/17/20 5:57 PM, H. S. Teoh wrote: On a side note, though, I find this idiosyncratic behaviour annoying when all I really want is to use an array as, e.g., a backing for a stack. For those cases, I ignore array capacity and keep a slice over the entire allocated storage, including elements t

Re: Avoid deallocate empty arrays?

2020-12-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/17/20 1:10 PM, IGotD- wrote: On Thursday, 17 December 2020 at 17:46:59 UTC, Steven Schveighoffer wrote: This isn’t correct. Can you post the code that led you to believe this? -Steve Sure. import std.algorithm; import std.typecons; import std.stdio; struct Buffer { this(size_t

Anyone has links to useful short-snippets of trait pattern examples?

2020-12-18 Thread frame via Digitalmars-d-learn
The manual often doesn't show the full potential of traits on the first sight or what they are really good for. But there are also all-day scenarios where I would just be happy for a quick lookup. For example, to assign a value to a class property which may have setter-overloads, I'm using a p