On Wed, Oct 23, 2002 at 06:11:08PM +0200, Andre Poenitz wrote:

> 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.

So how /would/ this work with base class pointers ?

I find the current scheme not scalable and very ugly. Not to mention the
recompile of everything when you add a new one. I am trying to reduce
the horrendous size of the Inset/UpdatableInset classes.

They are too large to work with. I like the idea of centralising the
traits, it is far easier to understand.

> 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?

I don't buy this argument.

regards
john

-- 
"This is mindless pedantism up with which I will not put."
        - Donald Knuth on Pascal's lack of default: case statement

Reply via email to