Error C2440 on Visual C++ compiler

I have been getting this error
error C2440: 'const_cast' : cannot convert from 'const DataAccess::Common::CTMCTable<taBoundingBox> *' to 'DataAccess::Generic::TTC::CRoadNetwork::CTMCTablesInAreaIterator'

on compilation in Visual C++

The code is


CRoadNetwork::CTMCTablesInAreaIterator::CTMCTablesInAreaIterator(const CRoadNetwork::CTMCTablesInAreaIterator& aOther)
: CRoadNetwork::CTMCTablesInAreaIterator::TSuper(aOther)
, iTMCLocationTable(aOther.iTMCLocationTable)
, iTableData(aOther.iTableData)
{
// Reset using copied iterator
TTMCTablesEntireIterator::Reset(iTableData.begin(), iTableData.end());
// const_cast<int*>(static_cast<const int*>(obj));
//TSuper::Reset(const_cast<CRoadNetwork::CTMCTablesInAreaIterator>(this->operator const CRoadNetwork::CTMCTablesInAreaIterator()), this->End());
<B>
TSuper::Reset(const_cast<CRoadNetwork::CTMCTablesInAreaIterator>(static_cast<CRoadNetwork::CTMCTablesInAreaIterator&>((*this)), this->End()));
</B>
}


Any suggesstions ?
Last edited on
What is this TSuper::Reset(const_cast<CRoadNetwork::CTMCTablesInAreaIterator> (missing &) good for? There is no const to cast away?
The code is the place where the error is generated
TSuper::Reset(const_cast<const CRoadNetwork::CTMCTablesInAreaIterator&>(static_cast<CRoadNetwork::CTMCTablesInAreaIterator&>((*this)), this->End()));


Adding the const doesnt help either
Do you even know what const_cast<...>(...) does?

However, the source of compiler error is a missplaced parenthesis:

TSuper::Reset(const_cast<const CRoadNetwork::CTMCTablesInAreaIterator&>(static_cast<CRoadNetwork::CTMCTablesInAreaIterator&> missplaced -> ( <- missplaced (*this)), this->End()));

remove that parenthesis and the compiler should take it.
Topic archived. No new replies allowed.