Re: Compile-time variadic equality

2018-03-10 Thread Nordlöw via Digitalmars-d-learn
On Saturday, 10 March 2018 at 08:49:19 UTC, Nordlöw wrote: How do I most conveniently merge these into one single `allSame` that can operate on mixtures of values and types? I found the privately defined `isSame` in std.meta that does this.

Re: Compile-time variadic equality

2018-03-10 Thread Nordlöw via Digitalmars-d-learn
On Friday, 9 March 2018 at 22:13:39 UTC, Simen Kjærås wrote: static if (allEqual!(staticMap!(ElementEncodingType, Rs))) { // compare Rs byCodeUnit } NoDuplicates!V.length == 1 BTW, `NoDuplicates` can handle both types and values (mixed) opposite to my `allSame` and `allSameType` defined

Re: Compile-time variadic equality

2018-03-09 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 9 March 2018 at 19:24:03 UTC, Nordlöw wrote: I'm looking for a function (that probably should be placed in std.meta) named something like `areEqual` that checks whether all it's arguments are equal or not. Is there such as function already in Phobos? My usage is static if

Re: Compile-time variadic equality

2018-03-09 Thread Nordlöw via Digitalmars-d-learn
On Friday, 9 March 2018 at 19:24:03 UTC, Nordlöw wrote: I'm looking for a function (that probably should be placed in std.meta) named something like `areEqual` that checks whether all it's arguments are equal or not. Is there such as function already in Phobos? My usage is static if

Compile-time variadic equality

2018-03-09 Thread Nordlöw via Digitalmars-d-learn
I'm looking for a function (that probably should be placed in std.meta) named something like `areEqual` that checks whether all it's arguments are equal or not. Is there such as function already in Phobos? My usage is static if (allEqual!(staticMap!(ElementEncodingType, Rs))) { //