Created
February 21, 2026 23:07
-
-
Save crazymonkyyy/7369d1dd91d73d9274b554816f9f4545 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!opend test app.d | |
| --- app.d | |
| import std; | |
| struct rangewrap(R...){ | |
| R r; | |
| auto opBinary(string op:"*",R2)(R2 r2){ | |
| return rangewrap!(R,R2)(r,r2); | |
| } | |
| void opDispatch(string __s__,T...)(T args){ | |
| foreach(tuple;cartesianProduct(r)){ | |
| mixin(__s__~"(tuple,args);"); | |
| }} | |
| } | |
| unittest{ | |
| (rangewrap!()() * [1,2,3] * "abc" * [true,false]).writeln; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment