hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-09-19 12:38:43 +0200
committerhachem <im@hachem.wtf>2026-09-19 12:38:43 +0200
commita79c97e04562b171780a24cba2cb1a71acfa4bbb (patch)
tree412642f948a30eb220512c304b34d60356f23b42 /examples
parent74a8a2b10a0513f5346ec47aa9b463e30f2b972e (diff)
types: array, extent, tuple_size, integral_constant
Diffstat (limited to 'examples')
-rw-r--r--examples/xs.sfinae36
1 files changed, 36 insertions, 0 deletions
diff --git a/examples/xs.sfinae b/examples/xs.sfinae
new file mode 100644
index 0000000..faae464
--- /dev/null
+++ b/examples/xs.sfinae
@@ -0,0 +1,36 @@
+// the original sin: how wide is int xs[20][20]
+
+::emit<
+ ::decltype(
+ ::extent<
+ ::array<
+ ::array<
+ ::remove_cv_t<
+ ::int32_t
+ >,
+ ::integral_constant<
+ ::size_t,
+ ::tuple_size<
+ ::array<
+ ::byte,
+ ::difference<'Z', 'F'>
+ >
+ >::value
+ >::value
+ >,
+ ::integral_constant<
+ ::size_t,
+ ::difference<'Z', 'F'>
+ >::value
+ >
+ >::value
+ )
+>::commit;
+
+// an array type says its extent, a bare type says its name
+::emit<
+ ::array<
+ ::byte,
+ ::difference<'Z', 'F'>
+ >
+>::commit;