OK, here's another one:
CreateIndex takes a constant pointer too because it doesn't modify it.
CRegistry::CIndex* CRegistry::CreateIndex(const CString& strName, const CIndex::RegType dwType, const DWORD dwTreeLevel, const CIndex* const pParent, const bool bAssignID)
Here's another one. pIndex->pParent is of type CIndex*.
pIndex = DEBUG_NEW CIndex;
pIndex->pParent = const_cast<CIndex*>(pParent); // CONST QUESTION
I guess the same principle applies here. CreateIndex doesn't modify the pointer, but it creates and returns an object that CAN be changed, so I guess I remove const here too?