
Stefan Seefeld wrote:
I agree. And, some simpler templating techniques may be used to map the current helt type discriminator to the (C++) type, thus dispatching calls by other means than what is typically referred to as 'visitation'.
What techniques? There is certainly the Visitor design pattern, but that's intrusive and that doesn't provide generic visitation.
(I still fail to appreciate the usefulness of those compile-time static strings. I find them rather ugly...)
If you want to compute something on a string at compile-time, you need a compile-time string. Here, it is needed to mangle the possibles names at compile-time and build an automaton to recognize the mangled name RTTI provides. With a regular string, you would have to mangle the name at runtime, then do a linear search within the possible cases.