Hi, I made a class that contain a pur virtual method wich I will implement it in the derivatives classes. But for now, I got an error in my .cpp file...here the essential part of my code :
namespace biblio
{
Reference::Reference(const std::string& p_auteurs, const std::string&
p_titre, int p_annee, const std::string& p_identifiant):
m_auteurs(p_auteurs), m_titre(p_titre), m_annee(p_annee), m_identifiant(p_identifiant)
{}
/**
* Some codes defines the functions in the class Reference
*/
//Pur virtual method
Reference::Reference* clone() const //error: ‘biblio::Reference::Reference’
//names the constructor, not the type
{
return 0;
}
/**
* Some codes
*/
} /* namespace biblio */
---------------------------------------
I'm french guy, sorry if my english have hurt your eyes...
And I must «implement» Reference* clone() const in .cpp, otherwise I got an error in others files (my test files) wich says :
the type must inherited pure virtual method "biblio::Reference::Reference* clone()"
I have search on internet for example wich I could resolve the error but none...