On Wednesday, 12 July 2017 at 18:49:23 UTC, Jack Applegame wrote:
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
Also what is it possible in D to write a function that accepts
an static array of any size?
void foo(size_t N)(ref int[N] arr) {
...
}
int[10] arr;
foo(arr);
Tha
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
Also what is it possible in D to write a function that accepts
an static array of any size?
void foo(size_t N)(ref int[N] arr) {
...
}
int[10] arr;
foo(arr);
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic array as length is not going
to change inside f.
Then just don't change the length... this is a correct way to do
it.
You could also allocate it
On Wednesday, 12 July 2017 at 05:45:13 UTC, Miguel L wrote:
Hi
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.l
Hi
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic array as length i
On Tuesday, 11 July 2017 at 08:23:02 UTC, Miguel L wrote:
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=
Miguel L wrote:
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile time. The
closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic arr
I need to create a non-dynamic array like this
void f(int x)
{
int[x] my_array;
...
this does not compile as x value needs to be known at compile
time. The closest to this I can get is:
void f(int x)
{
int[] my_array;
my_array.length=x;
but I don't really need a dynamic array as length is no