using NameAge = (string Name, int Age); // We can give the tuple properties names here and turn it in to a pseudo-class!
using unsafe FloatPtr = float*; // Notice the 'unsafe' modifier. New to C# 12 and required anywhere you want to alias a pointer-type.
using unsafe UserToIntFunc = delegate* managed<(string Name, int Age), int>; // I tried to use NameAge here instead of the value tuple explicitly, but no luck.
static int GetDoubleAge(NameAge user) => user.Age * 2;
static unsafe void Test() {
NameAge user = ("Ben", 33);
Console.WriteLine($"User's name is {user.Name}, and they are {user.Age} years old."); // "User's name is Ben, and they are 33 years old."
var f = 3f;
FloatPtr fPtr = &f;
*fPtr = 4f;
Console.WriteLine(f); // "4"
UserToIntFunc ageDoubler = &GetDoubleAge;
var doubleAge = ageDoubler(user);
Console.WriteLine($"Double my age is {doubleAge}."); // "Double my age is 66."
}
Code snippet taken from "Complete C# Quick Reference - C# 12".