[wx-dev] Re: template containers again

Robert Roebling robert at roebling.de
Mon Jul 2 01:04:26 PDT 2007


Vaclav Slavik wrote:

> Vadim Zeitlin wrote:
>
> >  I think this is a good idea. Of course, there already is a
> > wx/vector.h too but it doesn't define any class named wxVector and
> > we can hopefully even keep the WX_DECLARE_VECTOR macro working with
> > a new template-based implementation.
> 
> That's how I understood Robert's mail, that we would keep the existing 
> wxVector/wxArray "classes", but make them templates, and keep the 
> macros for backward compatibility.
> 
> To be perfectly clear, what I think would be the best thing to do is
> 1) replace wxVectorBase and the class defined by _WX_DECLARE_VECTOR 
> with a wxVector<T> template
> 2) for backward compatibility, define WX_DECLARE_VECTOR as a trivial 
> wrapper around this new class

Yes, wxVector is currently not documented and probably hardly
used, so the risk to break code is minimal.

> 3) do the same for other classes where it's possible (i.e. not the
> old deprecated wxList class etc.)

I would settle for wxVector<T>, if anyone has the energy to
rewrite wxHashMap. I'm not sure if converting wxArray is
possible without a change in semantics.

  Robert






More information about the wx-dev mailing list