Re: OR in version conditional compilation

2020-03-18 Thread Kagamin via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=19495#c1

Re: need help to get member function const address

2020-03-18 Thread Alex via Digitalmars-d-learn
On Thursday, 19 March 2020 at 04:30:32 UTC, Calvin P wrote: I use this code to get member function address on runtime: = struct A { this(){}; } auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr; = my question is, how to get it in compile time like static funct

Re: Best way to learn 2d games with D?

2020-03-18 Thread dangbinghoo via Digitalmars-d-learn
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer wrote: I want to try and learn how to write 2d games. I'd prefer to do it with D. I've found a ton of tutorials on learning 2d gaming with other languages. Is there a place to look that uses D for learning? Should I just start wit

Re: " include imported modules in the compilation " should exclude di file

2020-03-18 Thread Mathias Lang via Digitalmars-d-learn
On Monday, 9 March 2020 at 13:55:08 UTC, Calvin P wrote: The current compiler "-i=module_name" option will include imported modules as source code. When the module define from di file extension, I think compiler should avoid treat it as source file. What do you think? Sounds sensible. Can

need help to get member function const address

2020-03-18 Thread Calvin P via Digitalmars-d-learn
I use this code to get member function address on runtime: = struct A { this(){}; } auto ctor = (&__traits(getMember, A.init,"__ctor")).funcptr; = my question is, how to get it in compile time like static function address: = struct A { void d(){}; sta

Re: dub libs from home directory on windows

2020-03-18 Thread evilrat via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 19:53:58 UTC, jmh530 wrote: On Wednesday, 18 March 2020 at 15:10:52 UTC, Виталий Фадеев wrote: On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: I cannot build my app, so I was wondering if there is some clever way to solve this without hardcoded path to

Re: dub libs from home directory on windows

2020-03-18 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 15:10:52 UTC, Виталий Фадеев wrote: On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: I cannot build my app, so I was wondering if there is some clever way to solve this without hardcoded path to my profile name. Thank you very much for your help. I s

Re: OR in version conditional compilation

2020-03-18 Thread MoonlightSentinel via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 16:23:26 UTC, IGotD- wrote: you get the idea. So is this possible at all or do you have to duplicate the code for each version identifier despite they are equal for many version identifiers? The usual workaround is to define a common version, e.g. version(X86)

Re: OR in version conditional compilation

2020-03-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/18/20 12:23 PM, IGotD- wrote: I have not seen any example where version has several OR matches. Example idiom: version(X86_64 || X86) { } else version(ARM || Thumb) { }... you get the idea. So is this possible at all or do you have to duplicate the code for each version identifier desp

OR in version conditional compilation

2020-03-18 Thread IGotD- via Digitalmars-d-learn
I have not seen any example where version has several OR matches. Example idiom: version(X86_64 || X86) { } else version(ARM || Thumb) { }... you get the idea. So is this possible at all or do you have to duplicate the code for each version identifier despite they are equal for many version

Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: I cannot build my app, so I was wondering if there is some clever way to solve this without hardcoded path to my profile name. Thank you very much for your help. I see, you want without hardcoded path...

Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: Hi there, I'm using d2sqlite3 which has dependency on sqlite3.lib. When I'm building my app on windows I have a dub.sdl which has a line libs "%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3" platfo

Re: dub libs from home directory on windows

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Wednesday, 18 March 2020 at 13:52:20 UTC, Abby wrote: Hi there, I'm using d2sqlite3 which has dependency on sqlite3.lib. When I'm building my app on windows I have a dub.sdl which has a line libs "%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3" platfo

Re: @future attribute / @future keyword?

2020-03-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/18/20 6:20 AM, WebFreak001 wrote: I have read about @future before being some kind of opposite of deprecated. However when trying to search about it now again I can't find any mentions of it anywhere except on https://dlang.org/spec/traits.html#isFuture It's difficult enough to search fo

dub libs from home directory on windows

2020-03-18 Thread Abby via Digitalmars-d-learn
Hi there, I'm using d2sqlite3 which has dependency on sqlite3.lib. When I'm building my app on windows I have a dub.sdl which has a line libs "%USERPROFILE%/AppData/Local/dub/packages/d2sqlite3-0.18.3/d2sqlite3/lib/win64/sqlite3" platform="windows-x86_64-dmd" but unless I specify full path u

Re: @future attribute / @future keyword?

2020-03-18 Thread jxel via Digitalmars-d-learn
It never used @future, looks like that was only a suggestion in the dip. It also suggested @__future which it seems it was implemented with that. https://github.com/WalterBright/dmd/blob/2d4c7d4ed37645ed9d62e5e1a6652e5ae5b1fb26/test/runnable/future.d

@future attribute / @future keyword?

2020-03-18 Thread WebFreak001 via Digitalmars-d-learn
I have read about @future before being some kind of opposite of deprecated. However when trying to search about it now again I can't find any mentions of it anywhere except on https://dlang.org/spec/traits.html#isFuture It's difficult enough to search for "future" but even if limiting it to t

Re: Best way to learn 2d games with D?

2020-03-18 Thread Виталий Фадеев via Digitalmars-d-learn
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer wrote: I want to try and learn how to write 2d games. I'd prefer to do it with D. I've found a ton of tutorials on learning 2d gaming with other languages. Is there a place to look that uses D for learning? Should I just start wit