The problem with this method is that it breaks this rule: http://www.faqs.org/docs/artu/ch11s01.html
That is why I've said 'the API is broken'.
You have a
const literally for everything. I've learned the meaning of
const once (during studies) as the following:
const int* const my_method(const int* const&) const;
- the var pointed to by the returned ptr won't be changable
- the returned ptr itself won't be changable
- the var pointed to by the given ptr won't be changable (by the method)
- the given ptr itself won't be changable (by the method)
- the object the method belongs to won't be changed (during method call)
According to this the
const only tells you "
wxArrayString does not modify it's internal members when you
use the operator method
[]". This is true, even in out case. If we modify the reference we get that this has nothing to do with it anymore, as the call to the operator is done, so the validity of the
const rule.
Anyway - it's getting quite philosophic. I think the good thing is simply that you found that bug. Let the wx guys decide if/how to react. Having the knowledge in mind we know now what we shouldn't do next time... ;-)