| author | |
| committer | |
| log | 00f6148ec410aa69823cefee6ca671afade50489 |
| tree | 05ad8fa936d408672a11ae0f437d8fb59ba6c438 |
| parent | dccdb59e9fbdf9107efe29d385c21559c5430998 |
2 files changed, 14 insertions(+), 0 deletions(-)
src/compareFnBasic.zig created+13| ... | @@ -0,0 +1,13 @@ | ||
| 1 | const std = @import("std"); | ||
| 2 | const extras = @import("./lib.zig"); | ||
| 3 | |||
| 4 | pub fn compareFnBasic(N: type) fn (N, N) std.math.Order { | ||
| 5 | const S = struct { | ||
| 6 | pub fn compare(a: N, b: N) std.math.Order { | ||
| 7 | if (a < b) return .lt; | ||
| 8 | if (a > b) return .gt; | ||
| 9 | return .eq; | ||
| 10 | } | ||
| 11 | }; | ||
| 12 | return S.compare; | ||
| 13 | } | ||
src/lib.zig+1| ... | @@ -114,3 +114,4 @@ pub usingnamespace @import("./join.zig"); | ... | @@ -114,3 +114,4 @@ pub usingnamespace @import("./join.zig"); |
| 114 | pub usingnamespace @import("./omit.zig"); | 114 | pub usingnamespace @import("./omit.zig"); |
| 115 | pub usingnamespace @import("./swapMany.zig"); | 115 | pub usingnamespace @import("./swapMany.zig"); |
| 116 | pub usingnamespace @import("./ManyArrayList.zig"); | 116 | pub usingnamespace @import("./ManyArrayList.zig"); |
| 117 | pub usingnamespace @import("./compareFnBasic.zig"); |