From 09d29eba247d4d4268aae4312c90d3814e1f26e2 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 24 May 2023 13:11:13 +0100 Subject: [PATCH] TODO: Compile-time non-RTTI semi-unique type hashes (see include/types.hh for how to do this.) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for readpass's current commit: Curse − 凶 --- include/types.hh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 include/types.hh diff --git a/include/types.hh b/include/types.hh new file mode 100644 index 0000000..339940e --- /dev/null +++ b/include/types.hh @@ -0,0 +1,3 @@ +#pragma once + +//TODO: A very basic typeid: Using the constexpr __PRETTY_FUNCTION__ array slicing trick we used for `exopt::util::type_name()`, we can extract the unmangled, de-aliased type name T, we can then hash that at comptime, and give it static storage: Therefore __PRETTY_FUNCTION__ will not be given storage, but the resulting (far smaller, but still *almost* unique to each type name) hash, will be.