__traits isCopyable vs isPOD
Per Nordlöw
per.nordlow at gmail.com
Mon Nov 28 21:01:01 UTC 2022
On Monday, 28 November 2022 at 20:58:43 UTC, Per Nordlöw wrote:
> For which types `T` does
>
> ```d
> __traits(isCopyable, T)
> ```
>
> differ from
>
> ```d
> __traits(isPOD, T)
> ```
>
> ?
I'm asking because I have code like
```d
static if (__traits(isCopyable, Element))
insertAt(element, index);
else
insertAt(move(element), index);
```
and I wonder if one in those cases should be using `isCopyable`
or `isPOD`.
More information about the Digitalmars-d-learn
mailing list