I'm in the unfortunate situation of needing to interface with a library
that I can't change. To document the non-portable typecasts, I have
been using cast operators. However, I'm unable to silence C4311 with
reinterpret_cast. No other cast operator is appropriate. Is there a
two-step mechanism to deal with C4311 without offending VC++ 7.1?
CMsgReceiverQueueIterator itr = m_qParentReceiverList.begin ();
while ( itr != m_qParentReceiverList.end () )
{
CNkvMessageReceiver * thisRec = *itr;
// warning C4311: 'reinterpret_cast' : pointer truncation from
'std::allocator<_Ty>::value_type' to 'ULONG'
NkvMessage (reinterpret_cast <ULONG> (*itr));
itr++;
}
Thanks in advance,
- Ashok Thirumurthi