Re: non-intrusive inheritance

2007-06-14 Thread Andreas Vox
Andre Poenitz <[EMAIL PROTECTED]> writes: > You are certainly right when it comes to Model/View separation. The > dimension cache is a 'view thing' (depends e.g. on font size), so it > does not really belong _inside_ the insets. Also, insets that are way > off the visible area do not need it at al

Re: non-intrusive inheritance

2007-06-14 Thread Abdelrazak Younes
Andre Poenitz wrote: On Wed, Jun 13, 2007 at 11:25:34PM +0200, Abdelrazak Younes wrote: I think this is too complicated. A better solution IMHO is to remove the data member altogether and put that in the BufferView (either in the CoordCache or in in a new DimensionCache): [...] You are certai

Re: non-intrusive inheritance

2007-06-14 Thread Jean-Marc Lasgouttes
> "Alfredo" == Alfredo Braunstein <[EMAIL PROTECTED]> writes: Alfredo> Abdelrazak Younes wrote: >> Andre Poenitz wrote: >>> In the 1.6 cycle I'd like to get rid of the 'Dimension' data >>> member in Inset. As a lot of insets need that member and >>> derivation from a 'common' 'DimInset' base

Re: non-intrusive inheritance

2007-06-14 Thread Alfredo Braunstein
Abdelrazak Younes wrote: > Andre Poenitz wrote: >> >> In the 1.6 cycle I'd like to get rid of the 'Dimension' data member in >> Inset. As a lot of insets need that member and derivation from a >> 'common' 'DimInset' base was impractical I am thinking about using the >> old ATL trick: > > I think

Re: non-intrusive inheritance

2007-06-13 Thread Andre Poenitz
On Wed, Jun 13, 2007 at 11:25:34PM +0200, Abdelrazak Younes wrote: > Andre Poenitz wrote: > > > >In the 1.6 cycle I'd like to get rid of the 'Dimension' data member in > >Inset. As a lot of insets need that member and derivation from a > >'common' 'DimInset' base was impractical I am thinking about

Re: non-intrusive inheritance

2007-06-13 Thread Abdelrazak Younes
Andre Poenitz wrote: In the 1.6 cycle I'd like to get rid of the 'Dimension' data member in Inset. As a lot of insets need that member and derivation from a 'common' 'DimInset' base was impractical I am thinking about using the old ATL trick: I think this is too complicated. A better solution

Re: non-intrusive inheritance

2007-06-13 Thread Andre Poenitz
On Wed, Jun 13, 2007 at 10:19:14PM +0200, Stefan Schimanski wrote: > >>One problem I see here: What about the constructors? They must be > >>generic in DimStuff, no? > > > >If you need the constructors, your question is the answer: > > > > struct FatInset : DimStuff { > > FatInset(non-"

Re: non-intrusive inheritance

2007-06-13 Thread Stefan Schimanski
One problem I see here: What about the constructors? They must be generic in DimStuff, no? If you need the constructors, your question is the answer: struct FatInset : DimStuff { FatInset(non-"standard"-stuff-here) { ... } } No, it does not allow me to have non-standard cons

Re: non-intrusive inheritance

2007-06-13 Thread Andre Poenitz
On Wed, Jun 13, 2007 at 09:44:10PM +0200, Stefan Schimanski wrote: > > typedef DimStuff FatInset; > > Looks good. Nice trick. Would the following be possible? > > struct FatInset : DimStuff { > } Yes. > Would there be any disadvantage of this? I think it's easier to > understand. Cons

Re: non-intrusive inheritance

2007-06-13 Thread Stefan Schimanski
#include using namespace std; // Base of the trick: Data _and_ implementation of the feature. template struct DimStuff : Base { DimStuff() : w(30) {} int width() const { return w; } void setWidth(in