Re: Ascertaining!

2022-07-09 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 9 July 2022 at 10:12:00 UTC, Salih Dincer wrote: Hi All, I didn't know compiling was bottom-up. This example proves that. Because in single-line expressions, it takes value from the right, firstly. ```d void main() { int n; // true (n == 0) int i = 1; //

How to obtain Variant underlying type?

2022-07-09 Thread anonymouse via Digitalmars-d-learn
std.variant; Variant v = [[1], [2], [3]]; writeln(v.type); // int[][] typeof(v.type); // TypeInfo assert(v.type == typeid(int[][]); As demonstrated by the assert statement, .type returns the typeid of the underlying type. How would I obtain the actual type such that: auto vb = v.base;

Ascertaining!

2022-07-09 Thread Salih Dincer via Digitalmars-d-learn
Hi All, I didn't know compiling was bottom-up. This example proves that. Because in single-line expressions, it takes value from the right, firstly. ```d void main() { int n; // true (n == 0) int i = 1; // true (i == 1) int j = i = n; // all numbers are 0 n =

Re: How to obtain Variant underlying type?

2022-07-09 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 9 July 2022 at 14:36:44 UTC, anonymouse wrote: auto vb = v.base; // what should I put here to achieve the following: typeof(vb); // int[][] Impossible; Variant's type is only known at runtime, and this would require compile time knowledge.

Re: How to obtain Variant underlying type?

2022-07-09 Thread anonymouse via Digitalmars-d-learn
On Saturday, 9 July 2022 at 14:46:36 UTC, Adam D Ruppe wrote: Impossible; Variant's type is only known at runtime, and this would require compile time knowledge. Hmmm. Okay, thanks. What I really need to know is how many dimensions an array has and the total elements per dimension so that

Re: Background thread, async and GUI (dlangui)

2022-07-09 Thread Bagomot via Digitalmars-d-learn
On Friday, 8 July 2022 at 21:47:32 UTC, Ali Çehreli wrote: Aside: What does the return value 'true' mean? Docs says: Handler of click signal should return true if signal is processed. I am not sure whether my explicit way of starting a thread (albeit with std.parallelism) is the right way