Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MIT license
- // Stupid type id which I use
- #pragma once
- #include <cstdint>
- namespace Meta {
- using TypeId = uintptr_t;
- template <typename T>
- TypeId getTypeId()
- { // We use adress of this static dummy boolean as a unique id for classes!
- static bool dummy = false;
- static const auto id = reinterpret_cast<TypeId>(&dummy);
- return id;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement