Re: Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 25, 2017 at 05:43:34PM +, David Sanders via Digitalmars-d-learn wrote: [...] > Order is not important. (float, int) is a subset of (int, int, float). > (int, int, float) is not the same thing as (int, float). Duplicates in > the list are considered to be distinct set members. > >

Re: Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread David Sanders via Digitalmars-d-learn
On Tuesday, 25 April 2017 at 17:18:25 UTC, H. S. Teoh wrote: On Tue, Apr 25, 2017 at 05:08:36PM +, David Sanders via Digitalmars-d-learn wrote: I have two compile-time lists of types. How do I find their set intersection (to determine if one is a subset of the other) and their set differenc

Re: Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 25, 2017 at 05:08:36PM +, David Sanders via Digitalmars-d-learn wrote: > I have two compile-time lists of types. How do I find their set > intersection (to determine if one is a subset of the other) and their > set difference? See the block comments below: What's your definition o

Set Intersection and Set Difference on Compile-Time lists

2017-04-25 Thread David Sanders via Digitalmars-d-learn
I have two compile-time lists of types. How do I find their set intersection (to determine if one is a subset of the other) and their set difference? See the block comments below: import std.variant; alias Zero = void; struct One{} struct Difference(T, U) { static if (is(U == Zero)) alia