Re: mixin template's alias parameter ... ignored ?

2021-07-10 Thread Ali Çehreli via Digitalmars-d-learn
On 7/10/21 10:20 PM, someone wrote: > mixin template templateUGC ( > typeStringUTF, > alias lstrStructureID > ) { > > public struct lstrStructureID { The only way that I know is to take a string parameter and use it with a string mixin: mixin template templateUGC (

mixin template's alias parameter ... ignored ?

2021-07-10 Thread someone via Digitalmars-d-learn
```d mixin template templateUGC ( typeStringUTF, alias lstrStructureID ) { public struct lstrStructureID { typeStringUTF whatever; } } mixin templateUGC!(string, "gudtUGC08"); mixin templateUGC!(dstring, "gudtUGC16"); mixin templateUGC!(wstring, "gudtUGC32"); void

TDPL book and __traits(compiles...) snippet

2021-07-10 Thread Tony via Digitalmars-d-learn
In section 6.2 of The D Programming Language it talks about how the compiler will try and tell if you are going to use a null reference. It gives this code snippet below to demonstrate that. But with DMD v2.096.1-dirty I am getting that the compiler thinks the code is OK. With a "!" the assert

Re: assert(false) and GC

2021-07-10 Thread russhy via Digitalmars-d-learn
On Saturday, 10 July 2021 at 16:32:30 UTC, Mathias LANG wrote: On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote: On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote: I think it's the throwing/catching of the `Throwable` that is allocating. But I don't know from where

Re: how to make D program footprint smaller ?

2021-07-10 Thread Bastiaan Veelo via Digitalmars-d-learn
On Friday, 9 July 2021 at 03:07:04 UTC, dangbinghoo wrote: as questioned in the previous thread, I need to find out something like `--as-needed` options available for D. You are probably looking for the [-i](https://dlang.org/dmd-osx.html#switch-i%5B) compiler option. As far as I know `dub`

Re: Trivial simple OpenGl working example

2021-07-10 Thread Danny Arends via Digitalmars-d-learn
On Saturday, 10 July 2021 at 12:41:19 UTC, Виталий Фадеев wrote: On Saturday, 10 July 2021 at 08:36:07 UTC, Danny Arends wrote: On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: [...] OpenGL is being replaced by vulcan, just to plug my little project:

Re: assert(false) and GC

2021-07-10 Thread Mathias LANG via Digitalmars-d-learn
On Saturday, 10 July 2021 at 01:38:06 UTC, russhy wrote: On Saturday, 10 July 2021 at 01:23:26 UTC, Steven Schveighoffer wrote: I think it's the throwing/catching of the `Throwable` that is allocating. But I don't know from where the allocation happens. -Steve i think you are right Try

Re: Can I get the time "Duration" in "nsecs" acurracy?

2021-07-10 Thread Ali Çehreli via Digitalmars-d-learn
On 7/9/21 11:28 PM, rempas wrote: > So it's an OS thing? Don't listen to me on this. :) A quick search yesterday made me believe you need kernel support as well. Even if so, I would imagine modern kernel on modern hardware should work. Ali

Re: Trivial simple OpenGl working example

2021-07-10 Thread Виталий Фадеев via Digitalmars-d-learn
On Saturday, 10 July 2021 at 08:36:07 UTC, Danny Arends wrote: On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me

Re: Can I get the time "Duration" in "nsecs" acurracy?

2021-07-10 Thread Bruce Carneal via Digitalmars-d-learn
On Saturday, 10 July 2021 at 01:11:28 UTC, Steven Schveighoffer wrote: You can get better than hnsecs resolution with `core.time.MonoTime`, which can support whatever the OS supports. However, `Duration` and `SysTime` are stored in hnsecs for a very specific reason -- range. Simply put,

Re: Trivial simple OpenGl working example

2021-07-10 Thread Danny Arends via Digitalmars-d-learn
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me ? OpenGL is being replaced by vulcan, just to plug my little

Re: Can I get the time "Duration" in "nsecs" acurracy?

2021-07-10 Thread rempas via Digitalmars-d-learn
On Friday, 9 July 2021 at 21:04:42 UTC, Ali Çehreli wrote: On 7/9/21 1:54 PM, Paul Backus wrote: [...] Yes but the resolution seems not to be better than 100 nsecs. A quick research reveals a better resolution is not possible with common hardware on at least Linux. The following program