__traits for checking if a type is dynamic array (slice)

2020-08-18 Thread Stefan Koch via Digitalmars-d-learn
https://forum.dlang.org/post/ptgud7$16f6$1...@digitalmars.com On Monday, 26 November 2018 at 14:02:15 UTC, Andrei Alexandrescu wrote: On 11/26/18 4:04 AM, Per Nordlöw wrote: Why is there no - __traits(isArray, T) alongside - __traits(isStaticArray, T) and - __traits(isAssociativeArray, T)

Re: __traits for checking if a type is dynamic array (slice)

2018-11-26 Thread Andrei Alexandrescu via Digitalmars-d-learn
On 11/26/18 4:04 AM, Per Nordlöw wrote: Why is there no - __traits(isArray, T) alongside - __traits(isStaticArray, T) and - __traits(isAssociativeArray, T) Thanks for bringing this to my attention, Per. The core idea is to have __traits "primitive and ugly" and std.traits "convenient and

Re: __traits for checking if a type is dynamic array (slice)

2018-11-26 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 26 November 2018 at 10:53:25 UTC, Eduard Staniloiu wrote: I would like to see this in the compiler traits :D https://github.com/dlang/dmd/pull/9014

Re: __traits for checking if a type is dynamic array (slice)

2018-11-26 Thread Eduard Staniloiu via Digitalmars-d-learn
On Monday, 26 November 2018 at 09:28:37 UTC, Basile B. wrote: On Monday, 26 November 2018 at 09:04:25 UTC, Per Nordlöw wrote: Why is there no - __traits(isArray, T) alongside - __traits(isStaticArray, T) and - __traits(isAssociativeArray, T) when dmd already has `ENUMTY.Tarray` alongside -

Re: __traits for checking if a type is dynamic array (slice)

2018-11-26 Thread Basile B. via Digitalmars-d-learn
On Monday, 26 November 2018 at 09:04:25 UTC, Per Nordlöw wrote: Why is there no - __traits(isArray, T) alongside - __traits(isStaticArray, T) and - __traits(isAssociativeArray, T) when dmd already has `ENUMTY.Tarray` alongside - ENUMTY.Tsarray and - ENUMTY.Taarray and std.traits already

__traits for checking if a type is dynamic array (slice)

2018-11-26 Thread Per Nordlöw via Digitalmars-d-learn
Why is there no - __traits(isArray, T) alongside - __traits(isStaticArray, T) and - __traits(isAssociativeArray, T) when dmd already has `ENUMTY.Tarray` alongside - ENUMTY.Tsarray and - ENUMTY.Taarray and std.traits already has a wrapper for this at