After thinking about this a bit, I think this would be an acceptable approach (note: this is just pseudo-code):
UniqueId(Type) = Type.stringof ~ MemberIds!(Type.tupleof)
UniqueId(Type) if( Type is builtin ) = Type.stringof
MemberIds(M, Ms...) = "," ~ UniqueId!(typeof(M))
~ "@" ~ ToString!(M.offsetof)
~ ":" ~ M.stringof
~ MemberIds!(Ms)
That is, build a unique identifier from the type name (you may need to cancel the module and package, not sure) and each element type identifier, offset and name.
Depending on what you want, you can delete the member name.
source
share