Advertisement
Guest User

Template Error: no appropriate default constructor available

a guest
Mar 24th, 2012
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. 1> ecosystem.cpp
  2. 1>c:program files (x86)microsoft visual studio 10.0vcincludemap(172): error C2512: 'beatle::beatle' : no appropriate default constructor available
  3. 1> c:program files (x86)microsoft visual studio 10.0vcincludemap(165) : while compiling class template member function 'beatle &std::map<_Kty,_Ty>::operator [](int &&)'
  4. 1> with
  5. 1> [
  6. 1> _Kty=tokenID,
  7. 1> _Ty=beatle
  8. 1> ]
  9. 1> c:userszakdocumentsvisual studio 2010projectsascii_sivvureascii_sivvureecosystem.h(22) : see reference to class template instantiation 'std::map<_Kty,_Ty>' being compiled
  10. 1> with
  11. 1> [
  12. 1> _Kty=tokenID,
  13. 1> _Ty=beatle
  14. 1> ]
  15.  
  16. typedef std::map<tokenID,beatle> Beatles;
  17.  
  18. class ecosystem
  19. {
  20. private:
  21. line 22: Beatles m_Beatles;
  22. };
  23.  
  24. ecosystem::ecosystem(): m_output( output() )
  25. {
  26. Beatles m_Beatles;
  27. }
  28.  
  29. void ecosystem::populate()
  30. {
  31. if (m_isMatingSeason && ( random(0,1000) < rateMATING ) )
  32. {
  33. beatle babyBeatle = breed();
  34. m_Beatles[babyBeatle.getTokenID()] = babyBeatle;
  35. m_field.occupy(babyBeatle.getTokenID(), babyBeatle.getLocation() );
  36. }
  37. }
  38.  
  39. m_Beatles[babyBeatle.getTokenID()] = babyBeatle;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement