diff --git a/includes/type/magic.pat b/includes/type/magic.pat new file mode 100644 index 0000000..22d0392 --- /dev/null +++ b/includes/type/magic.pat @@ -0,0 +1,19 @@ +#include +#include + +namespace type { + + struct Magic { + char value[std::string::length(ExpectedValue)]; + std::assert(value == ExpectedValue, std::format("Invalid magic value! Expected \"{}\", got \"{}\".", ExpectedValue, value)); + } [[sealed, format("type::impl::format_magic")]]; + + namespace impl { + + fn format_magic(ref auto magic) { + return magic.value; + }; + + } + +}