On Wed, Oct 23, 2002 at 03:49:43PM +0100, John Levon wrote: > > Look. I maintain a hierarchy of about 40 or 50 insets with a base class > > I was kind of hoping you'd embarrass me by showing how easy it is to do > inset_traits, actually. Oh well.
You mean something like template <class Inset> struct inset_traits { bool shouldBeUsedInTocList = false; }; template <> struct inset_traits<FooBarInset> { bool shouldBeUsedInTocList = true; }; ? I don't see much that's worth the extra complexity, _especially_ if you want to access that with base class pointers/references as this basically ends up implementing something like vtables. The compiler is better at that. Moreover, not many people will understand that "pattern" whereas even the average Java programmer has a good grasp of virtual functions (even if "virtual" sounds unfamiliar). So from a purely practical POV: Why bother? Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson)