OK, here's another one:
Code:
CRegistry::CIndex* CRegistry::CreateIndex(const CString& strName, const CIndex::RegType dwType, const DWORD dwTreeLevel, const CIndex* const pParent, const bool bAssignID)
CreateIndex takes a constant pointer too because it doesn't modify it.
But:
Code:
CIndex* pIndex;
pIndex = DEBUG_NEW CIndex;
// ...
pIndex->pParent = const_cast<CIndex*>(pParent); // CONST QUESTION
// ...
Here's another one. pIndex->pParent is of type CIndex*.
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?