On Sunday, 11 February 2018 at 14:06:32 UTC, rjframe wrote:
On Sat, 10 Feb 2018 10:55:30 +, rumbu wrote:
If you separate initialization to a static this, you'll get a
compile error:
```
immutable uint256[78] pow10_256;
static this() {
// Error: mismatched array lengths, 78 and 2
On Sat, 10 Feb 2018 10:55:30 +, rumbu wrote:
> I know that according to language spec
> (https://dlang.org/spec/arrays.html#static-init-static) you can skip
> declaring all your elements in a fixed size array.
>
> I'm just recovering from a bug which took me one day to discover because
> of t
On Sunday, 11 February 2018 at 01:26:59 UTC, psychoticRabbit
wrote:
On Sunday, 11 February 2018 at 01:13:00 UTC, psychoticRabbit
wrote:
Well, in C.. I can do:
int arr[2] = { [0]=10, [1]=20 };
I cannot work out how to do that in D yet (anyone know??)
Oh. just worked it out after reading thi
On Sunday, 11 February 2018 at 01:13:00 UTC, psychoticRabbit
wrote:
Well, in C.. I can do:
int arr[2] = { [0]=10, [1]=20 };
I cannot work out how to do that in D yet (anyone know??)
Oh. just worked it out after reading this thread ;-)
int[2] arr = [ 0:10, 1:20 ];
On Saturday, 10 February 2018 at 10:55:30 UTC, rumbu wrote:
I have a large static initialized array, let's say int[155],
and I forgot to declare the last element:
int[155] myarray = [
a,
b,
c,
...
//forgot to declare the 155th element
];
Well, in C.. I can do:
int arr[2] = { [0]
On Saturday, 10 February 2018 at 15:54:03 UTC, rumbu wrote:
On Saturday, 10 February 2018 at 14:55:49 UTC, b2.temp wrote:
On Saturday, 10 February 2018 at 14:35:52 UTC, rumbu wrote:
In this case, it there any way to be sure that I declared all
the elements I intended? Obviously, without count
On Saturday, 10 February 2018 at 14:55:49 UTC, b2.temp wrote:
On Saturday, 10 February 2018 at 14:35:52 UTC, rumbu wrote:
In this case, it there any way to be sure that I declared all
the elements I intended? Obviously, without counting them by
hand.
At the level of the library use a templa
On Saturday, 10 February 2018 at 14:35:52 UTC, rumbu wrote:
On Saturday, 10 February 2018 at 12:28:16 UTC, b2.temp wrote:
On Saturday, 10 February 2018 at 10:55:30 UTC, rumbu wrote:
I know that according to language spec
(https://dlang.org/spec/arrays.html#static-init-static) you
can skip decl
On Saturday, 10 February 2018 at 12:28:16 UTC, b2.temp wrote:
On Saturday, 10 February 2018 at 10:55:30 UTC, rumbu wrote:
I know that according to language spec
(https://dlang.org/spec/arrays.html#static-init-static) you
can skip declaring all your elements in a fixed size array.
I'm just rec
https://issues.dlang.org/show_bug.cgi?id=481#c40
On Saturday, 10 February 2018 at 10:55:30 UTC, rumbu wrote:
I know that according to language spec
(https://dlang.org/spec/arrays.html#static-init-static) you can
skip declaring all your elements in a fixed size array.
I'm just recovering from a bug which took me one day to
discover because o
I know that according to language spec
(https://dlang.org/spec/arrays.html#static-init-static) you can
skip declaring all your elements in a fixed size array.
I'm just recovering from a bug which took me one day to discover
because of this.
I have a large static initialized array, let's say
12 matches
Mail list logo