Re: How do I copy struct having immutable pointer member when enabled DIP1000?

2020-08-30 Thread ag0aep6g via Digitalmars-d-learn
On 31.08.20 06:24, outlandkarasu wrote: I thought that I cannot make non-scope `ref` parameters from `scope` array references. But I found It allowed currently. [...] enum Currency : string {     USD = "USD", EUR = "EUR", GBP = "GBP", JPY = "JPY", } struct Instrument {     Currency bid;   

Re: How do I convert an ISO 8601 datetime into a unix timestamp - at compile-time?

2020-08-30 Thread Andrej Mitrovic via Digitalmars-d-learn
On Friday, 28 August 2020 at 12:35:26 UTC, Steven Schveighoffer wrote: It's trying to look up the local timezone at compile time. You need to specify a time zone: static time = SysTime(DateTime.fromISOString("20220101T00"), UTC()).toUnixTime; -Steve Aw, thanks Steve!

Re: How do I copy struct having immutable pointer member when enabled DIP1000?

2020-08-30 Thread outlandkarasu via Digitalmars-d-learn
On Sunday, 30 August 2020 at 16:33:58 UTC, ag0aep6g wrote: On 30.08.20 17:24, outlandkarasu wrote: enum Tag { tag = "tag" } struct A { Tag tag; } A createA() @safe {     scope a = A(Tag.tag);     // Error: scope variable a may not be returned     return a;     // NG     //

Re: Since DMD 2.089.0 and later, compiled .exe showing SFX zip and opening with winRar when use resource.

2020-08-30 Thread novice2 via Digitalmars-d-learn
5. Open WinRAR support issue 6. Upload your .exe and say WinRar version then other peoples can reproduce

Re: Since DMD 2.089.0 and later, compiled .exe showing SFX zip and opening with winRar when use resource.

2020-08-30 Thread novice2 via Digitalmars-d-learn
Dear Marcone, that you want we all to do? Rar detect sfx by small signature, and some bytes in exe looks like signature. But this is not the problem - just do not open your exe with rar. Or i just don't understand... Another options: 1. try to compile with anoter .res or/and another .ico (if

Re: Since DMD 2.089.0 and later, compiled .exe showing SFX zip and opening with winRar when use resource.

2020-08-30 Thread Marcone via Digitalmars-d-learn
On Wednesday, 19 August 2020 at 08:27:34 UTC, Kagamin wrote: On Tuesday, 18 August 2020 at 19:01:17 UTC, Marcone wrote: SFX zip in it is properties: https://i.imgur.com/dH7jl5n.png Opening with winRar: https://i.imgur.com/s7C9mZn.png Probably winrar messing with your file manager. Try to

Re: D binary io functions

2020-08-30 Thread Andy Balba via Digitalmars-d-learn
On Sunday, 30 August 2020 at 10:02:09 UTC, Arjan wrote: On Sunday, 30 August 2020 at 06:00:20 UTC, Andy Balba wrote: going nuts trying to figure out which D functions will read/write binary files see this blog: http://nomad.uk.net/articles/working-with-files-in-the-d-programming-language.html

Re: How do I copy struct having immutable pointer member when enabled DIP1000?

2020-08-30 Thread ag0aep6g via Digitalmars-d-learn
On 30.08.20 17:24, outlandkarasu wrote: enum Tag { tag = "tag" } struct A { Tag tag; } A createA() @safe {     scope a = A(Tag.tag);     // Error: scope variable a may not be returned     return a;     // NG     // return A(a);     // return A(a.tag); } [...] I

Re: D binary io functions

2020-08-30 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 30 August 2020 at 10:02:09 UTC, Arjan wrote: On Sunday, 30 August 2020 at 06:00:20 UTC, Andy Balba wrote: going nuts trying to figure out which D functions will read/write binary files see this blog: http://nomad.uk.net/articles/working-with-files-in-the-d-programming-language.html

How do I copy struct having immutable pointer member when enabled DIP1000?

2020-08-30 Thread outlandkarasu via Digitalmars-d-learn
I wrote a struct that having a std.datetime.SysTime member. However this struct cannot copy from scope variable. I think because SysTime has a immutable(TimeZone) member and it cannot copy to out of scope. struct A { SysTime timestamp; } A createA() @safe { scope a =

Re: D binary io functions

2020-08-30 Thread Arjan via Digitalmars-d-learn
On Sunday, 30 August 2020 at 06:00:20 UTC, Andy Balba wrote: going nuts trying to figure out which D functions will read/write binary files see this blog: http://nomad.uk.net/articles/working-with-files-in-the-d-programming-language.html

Re: D binary io functions

2020-08-30 Thread starcanopy via Digitalmars-d-learn
On Sunday, 30 August 2020 at 06:00:20 UTC, Andy Balba wrote: going nuts trying to figure out which D functions will read/write binary files For starters: https://dlang.org/phobos/std_stdio.html#.File.byChunk https://dlang.org/phobos/std_stdio.html#.File.rawRead

D binary io functions

2020-08-30 Thread Andy Balba via Digitalmars-d-learn
going nuts trying to figure out which D functions will read/write binary files