Non-recursive maxSizeOf

Per Nordlöw per.nordlow at gmail.com
Thu Aug 6 01:22:05 UTC 2020


On Thursday, 6 August 2020 at 01:17:51 UTC, lithium iodate wrote:
> more love for phobos pls
>
> template maxSizeOf(T...)
> {
>     template sizeOf(T) { // doesn't exist in phobos?
>         enum sizeOf = T.sizeof;
>     }
>     enum size_t maxSizeOf = maxElement([staticMap!(sizeOf, T)]);
> }

`std.meta.staticMap` is defined recursively....


More information about the Digitalmars-d-learn mailing list