|
Boost : |
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2008-03-28 17:51:12
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk