Loki's tricky templates
Phil Edwards
pedwards@disaster.jaj.com
Fri Apr 20 14:48:00 GMT 2001
On Fri, Apr 20, 2001 at 11:14:04PM +0200, Paolo Carlini wrote:
> compile Alexandrescu's Loki library (*) with current Gcc3.0 (Gcc3.1).
[...]
> (*) http://www.awl.com/cseng/titles/0-201-70431-5
More officially, www.moderncppdesign.com, but right now it's the same thing.
This is an impressive piece of distillation. I remember GenScatterHierarchy
from his text, but not CyclicVisitor. It looks to me like, although we can
see that DocElement is bound to AtomicType, and Visitor<DocElement,void>
is subclassed to produce Result/Unit, I had to "instantiate" GSH in my
head before I could figure out what Unit was supposed to bind to, thus
enabling GSH to actually be instantiated. I think this is valid code,
but template-template arguments are not my strong suit by a long shot.
Phil
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.
More information about the Gcc
mailing list