How to detect if an array if dynamic or static
jmh530 via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu Feb 25 09:27:59 PST 2016
On Wednesday, 24 February 2016 at 21:48:14 UTC, mahdi wrote:
> Suppose we have a function like this:
>
> void diss(int[] array) ...
>
> How can we detect is `array` is static (fixed size) or dynamic,
> inside the function body?
I don't see that anyone has mentioned it but:
https://dlang.org/phobos/std_traits.html#isStaticArray
https://dlang.org/phobos/std_traits.html#isDynamicArray
More information about the Digitalmars-d-learn
mailing list