Hi,
I've got a problem with a class Player that should have a vector of Monster as an attribute. The real problem is that the class Monster has already a vector of Attack as attribute, so the compiler says:
||=== Build: Debug in exercise (compiler: GNU GCC Compiler) ===|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\stl_construct.h|77|error: no matching function for call to 'Mostro::Mostro(const Mostro&)'|
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\stl_construct.h|77|note: candidates are:|
error: no matching function for call to 'Mostro::Mostro(const Mostro&)'
|note: candidates are:
Mostro::Mostro(Mostro&)
-¿did you need to code the copy constructor? (¿why is member-wise copy not good for you?)
-¿do you have a good reason to not ask for a constant reference? (¿how are you changing the parameter, and why?)
Thanks for the hints ne555! But I've found the errors and resolved! I needed to code the copy constructor but I didn't know that it's indispensable the use of constant getters...thank you however!