(NOTE: C++)
Polymorphism might be another:
Code:
pp< std::vector< pp<CItemData> > > CListBox::GetAllItemData()
GetAllItemData returns a vector of CItemData objects. However...
Code:
typedef pp< std::vector< pp< Stuff::CItemDataTemplate<CString> > > > ItemDataVector;
ItemDataVector pData = *(ItemDataVector*)&m_Logs.GetAllItemData();
I stored Stuff::CItemDataTemplate<CString> objects which I need to retrieve. Since it's derived from CItemData, it's perfectly fine to add it, but then I need to cast it back or use virtual functions to manipulate the data.
So in this case, a hack might be justified.