code_junkie

Can't initialize an object in a member initialization list

Nov 12th, 2011
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. CCalcArchive::CCalcArchive() : m_calcMap()
  2. {
  3. }
  4.  
  5. typedef CTypedPtrMap<CMapStringToPtr, CString, CCalculation*> CCalcMap;
  6. CCalcMap& m_calcMap;
  7.  
  8. error C2440: 'initializing' : cannot convert from 'int' to 'CCalcArchive::CCalcMap &'
  9.  
  10. mfctest.cpp(72) : warning C4413: '' : reference member is initialized to a temporary
  11. that doesn't persist after the constructor exits
Add Comment
Please, Sign In to add comment