From 2da2c56c72e7085bd9a52f848df90c6fc701de7f Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 19 Sep 2026 22:04:44 +0200 Subject: docs: add tutorial --- tutorial/01_hello.sfinae | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tutorial/01_hello.sfinae (limited to 'tutorial/01_hello.sfinae') diff --git a/tutorial/01_hello.sfinae b/tutorial/01_hello.sfinae new file mode 100644 index 0000000..81d84e6 --- /dev/null +++ b/tutorial/01_hello.sfinae @@ -0,0 +1,24 @@ +// hello, world +// +// there are no strings. there are no string literals. there is ::tuple, a type +// made of other types, and ::integral_constant<::char, N>, a type that happens +// to be a character. ::emit prints whatever a type has to say and then a newline +// there are also no numbers, so every character is its own distance from '\0' + +::emit< + ::tuple< + ::integral_constant<::char, ::difference<'H', '\0'>>, + ::integral_constant<::char, ::difference<'e', '\0'>>, + ::integral_constant<::char, ::difference<'l', '\0'>>, + ::integral_constant<::char, ::difference<'l', '\0'>>, + ::integral_constant<::char, ::difference<'o', '\0'>>, + ::integral_constant<::char, ::difference<',', '\0'>>, + ::integral_constant<::char, ::difference<' ', '\0'>>, + ::integral_constant<::char, ::difference<'w', '\0'>>, + ::integral_constant<::char, ::difference<'o', '\0'>>, + ::integral_constant<::char, ::difference<'r', '\0'>>, + ::integral_constant<::char, ::difference<'l', '\0'>>, + ::integral_constant<::char, ::difference<'d', '\0'>>, + ::integral_constant<::char, ::difference<'!', '\0'>> + > +>::commit; -- cgit v1.3