get rid of base arrays in wxUSE_STL build, we don't need them there and deriving wxFooPtr from wxBaseArrayPtrVoid makes it iterators return void pointers instead of those of the correct type; added test case to check for this

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-07-22 01:01:56 +00:00
parent 87ec008f42
commit 35d5da677d
3 changed files with 79 additions and 89 deletions

View File

@@ -139,6 +139,15 @@ WX_DEFINE_SORTED_ARRAY_CMP_SHORT(ushort, UShortCompareValues, wxSortedArrayUShor
WX_DEFINE_SORTED_ARRAY_CMP_INT(int, IntCompareValues, wxSortedArrayInt);
struct Item
{
Item(int n_ = 0) : n(n_) { }
int n;
};
WX_DEFINE_ARRAY_PTR(Item *, ItemPtrArray);
// ----------------------------------------------------------------------------
// test class
// ----------------------------------------------------------------------------
@@ -594,4 +603,10 @@ void ArraysTestCase::TestSTL()
{
CPPUNIT_ASSERT( *it == i );
}
ItemPtrArray items;
items.push_back(new Item(17));
CPPUNIT_ASSERT_EQUAL( 17, (*(items.rbegin()))->n );
CPPUNIT_ASSERT_EQUAL( 17, (**items.begin()).n );
}