Re: equivalent of typeid(Class).name at compile-time

2019-11-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/22/19 4:04 AM, Jacob Carlborg wrote: On Thursday, 21 November 2019 at 20:44:19 UTC, Steven Schveighoffer wrote: I thought I could do typeid(Class).name to get the class name that will be returned at runtime if you did typeid(instance).name. But it's not accessible at compile-time. What

Re: How to simulate Window's "Press any key to continue..."

2019-11-22 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 22 November 2019 at 04:10:23 UTC, FireController#1847 wrote: I'm an extreme beginner to DLang (just started using it.. oh, an hour ago?), and I already can't figure out a, what I'd consider, fairly simplistic thing. This is my current code: module DTestApp1; import std.stdio;

Re: equivalent of typeid(Class).name at compile-time

2019-11-22 Thread Alexandru Ermicioi via Digitalmars-d-learn
On Thursday, 21 November 2019 at 20:48:03 UTC, Adam D. Ruppe wrote: On Thursday, 21 November 2019 at 20:45:16 UTC, Steven Schveighoffer wrote: To clarify, I need the compile time string that will match typeid(instance).name, so I can match the derived type. You have to make sure that the

Re: How to simulate Window's "Press any key to continue..."

2019-11-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 22 November 2019 at 09:25:37 UTC, Ali Çehreli wrote: https://github.com/adamdruppe/arsd/blob/master/terminal.d I have this exact thing as a sample in my docs: http://dpldocs.info/experimental-docs/arsd.terminal.html#single-key You could wrap that up in a function if you don't

Re: How to simulate Window's "Press any key to continue..."

2019-11-22 Thread IGotD- via Digitalmars-d-learn
On Friday, 22 November 2019 at 04:45:21 UTC, Mike Parker wrote: On Friday, 22 November 2019 at 04:22:07 UTC, FireController#1847 wrote: Right, but readln will only wait until the user presses the delimiter (by default Enter/Return). I want it to wait until ANY key is pressed, not a specific

Blog Post #90: Reader Requests

2019-11-22 Thread Ron Tarrant via Digitalmars-d-learn
Readers Peter Pinkness (over on the GtkD Forum) and GreatSam4Sure (the D Forum) requested coverage of some techniques for centering a GTK Window and decorating a Window with a custom icon. That's what today's post is about: https://gtkdcoding.com/2019/11/22/0090-titlebar-icons.html Also, I

Re: How to simulate Window's "Press any key to continue..."

2019-11-22 Thread Ali Çehreli via Digitalmars-d-learn
On 11/21/19 9:10 PM, Mike Parker wrote:> On Friday, 22 November 2019 at 04:45:21 UTC, Mike Parker wrote: > You need to call readf with a character > format string (%c): > > import std.stdio; > void main() > { > writeln("Press any key to continue..."); > > char c; > readf("%c", );

Re: equivalent of typeid(Class).name at compile-time

2019-11-22 Thread Jacob Carlborg via Digitalmars-d-learn
On Thursday, 21 November 2019 at 20:44:19 UTC, Steven Schveighoffer wrote: I thought I could do typeid(Class).name to get the class name that will be returned at runtime if you did typeid(instance).name. But it's not accessible at compile-time. What compile-time string should I use for