On Mon, Aug 27, 2001 at 08:21:50AM +0200, Andre Poenitz wrote:
> > 60 template <class Base>
> > 61 void ControlDialog<Base>::show()
> > 62 {
> > 63 if (isBufferDependent() && !lv_.view()->available())
> > 64 return;
> > 65
> > 66 setParams();
> > 67
> > 68 static bool isBuilt = false;
> > 69 if (!isBuilt) {
> > 70 isBuilt = true;
> > 71 view().build();
> > 72 }
> >
> >
> > unfortunately, the static seems to be sharing itself with all templatised
> > objects. How can we get the expected per-dialog isBuilt() functionality ?
>
> That observation does not fit too well into my understanding of how C++
> works, but I don't have the standard around for proper investigation.
>
> I'd say every instance of the function should have its own static. How else
> could it work when the type of 'isBuilt' depents on the template parameter?
It works the right way (G++ 3.0). isBuilt is not per-dialog, but per
dialog class.
>
> Andre'
>
> --
> André Pönitz ............................................. [EMAIL PROTECTED]
--
Yves