template containers again
Robert Roebling
robert at roebling.de
Sun Jul 1 02:55:59 PDT 2007
Vadim Zeitlin wrote:
> Robert Roebling wrote:
>
> RR> wxWidgets 3 won't even compile without templates so that policy
> RR> already has changed. As far as I understand, wxList, wxArray
> RR> and wxVector derive from their STL counterparts if compiled
> RR> in STL mode, but we still cannot write wxList<int>. Or can
> RR> we?
>
> No, we can't, and we won't be able to as long as we keep wxList
> as a synonym (more or less) for wxList<wxObject> a.k.a. wxObjectList.
That was the reason. So we cannot replace all our container classes,
but how about writing 1 simple template container that we can use
equally with and without STL, and that doesn't have the problem of
being used "wrongly" like wxList. wxVector would be the obvious
choice, I'm not sure if rewriting wxArray would work (is wxArray
alone a full class?).
Although it has been said repeatedly, that we might opt for using
STL within wxWidgets, noone has done that sofar so we are still
using the ugly macros. Is anyone against making writnig a
wxVector<> template class and making it the prefered class for
random access containers. It would derive from (or be) std::vector
in STL mode.
Robert
More information about the wx-dev
mailing list