-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.{ | ||
.name = "blackmagic", | ||
.version = "0.2.0", | ||
.version = "0.3.0", | ||
.paths = .{ "build.zig", "build.zig.zon", "include", "README.md", "LICENSE" }, | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "blackmagic/token.h" // CONCAT | ||
|
||
/** | ||
* @file | ||
* Manipulate tuples | ||
*/ | ||
|
||
/** Extract the first element of a tuple */ | ||
#define TUPLE_FIRST(A, ...) A | ||
/** Extract the second element of a tuple */ | ||
#define TUPLE_SECOND(A, B, ...) B | ||
/** Extract the third element of a tuple */ | ||
#define TUPLE_THIRD(A, B, C, ...) C | ||
|
||
/** Extract the Nth element of a tuple */ | ||
#define TUPLE_GET(N, TUPLE) CONCAT(TUPLE_GET_, N) TUPLE | ||
|
||
#define TUPLE_GET_0(A, ...) A | ||
#define TUPLE_GET_1(A,B, ...) B | ||
#define TUPLE_GET_2(A,B,C, ...) C | ||
#define TUPLE_GET_3(A,B,C,D, ...) D | ||
#define TUPLE_GET_4(A,B,C,D,E, ...) E | ||
#define TUPLE_GET_5(A,B,C,D,E,F, ...) F | ||
#define TUPLE_GET_6(A,B,C,D,E,F,G, ...) G |