On 27 Feb 2001, Lars Gullik Bjønnes wrote:
[...]
> One thing I have been wondering about is why the buttoncontroller
> takes a pointer to a buttonpolicy, better would be a a traits class
> and make the ButtonController a template class that thakes the needed
> trait.
>
>
> template <class BP>
> class ButtonController : public noncopyable {
> public:
> typedef BP Policy;
> private:
> Policy bp;
> }
>
>
> Perhaps not as easy to do now.
That's how I originally wrote it but due to something I can't remember I
changed it to how it is now. Ummm I think it was because of the way I
wanted to use ButtonController and pass a trait (ie. a Policy) to create
the instance rather than pass a ButtonController<WhateverPolicy> in the
definition. Feel free to suggest how to use a trait such that I can pass
the trait from a derived class to redefine the button controllers policy
(when the button controller is a part of the base class).
> Another options is to have all the different policies as static
> objects somewhere. (what I really do no like is the delete &bp_ i see
> in some destructors)
Understandable.
Allan. (ARRae)