Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module meta.seq;
- public import std.meta;
- bool Contains (alias Elem, Seq...)() {
- return staticIndexOf!(Elem, Seq) >= 0;
- }
- template ApplyContains (Seq...) {
- template Applied (alias Elem) {
- alias Applied = Contains!(Elem, Seq);
- }
- }
- template Intersect (Left...) {
- template To (Right...) {
- alias To = Filter!(ApplyContains!(Right).Applied, Left);
- }
- }
- template Difference (Left...) {
- template To (Right...) {
- alias To = Filter!(templateNot!(ApplyContains!(Right).Applied), Left);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement