Note that there are some explanatory texts on larger screens.

plurals
  1. POError C2558 - copy constructor
    primarykey
    data
    text
    <p>When I compile my class, I get a serious error:</p> <blockquote> <p>C2558 no copy constructor available or copy constructor is declared 'explicit'</p> </blockquote> <p>But my copy constructor is neither private nor explicit!</p> <p>Header:</p> <pre><code>#include "Csequence.h" using namespace std; class Cnoeud { private: Cnoeud *oNOEpere; vector&lt;Cnoeud&gt; oNOEfils; Csequence oNOEsequence; bool oNOEStatut; public: // Liste des constructeurs Cnoeud(); Cnoeud(Cnoeud &amp;); ~Cnoeud(){} // Liste des accesseurs et des modificateurs Cnoeud * NOEAfficherpere (){ return oNOEpere;} vector&lt;Cnoeud&gt; NOEAfficherfils() {return oNOEfils;} Csequence NOEAffichersequence() {return oNOEsequence;} bool NOEAfficherstatut() { return oNOEStatut;} void NOEModifierpere(Cnoeud oNOEp){ *oNOEpere=oNOEp;} void NOEModifierfils(vector&lt;Cnoeud&gt;); void NOEModifiersequence(Csequence oNOEs){oNOEsequence = oNOEs;} void NOEModifierstatut(bool {oNOEStatut = b;} // Liste des fonctions membres void NOEViderfils(){ oNOEfils.clear();} // Surcharge de l'opérateur d'affectation Cnoeud &amp; operator=(Cnoeud &amp;) ; }; </code></pre> <p>Source:</p> <pre><code>Cnoeud.cpp #include &lt;iostream&gt; #include &lt;vector&gt; #include "Cnoeud.h" using namespace std; Cnoeud::Cnoeud() { oNOEStatut= 0; oNOEsequence.SEQInitialiserdatesfin(); oNOEsequence.SEQInitialisersequence(); oNOEpere = NULL; } Cnoeud::Cnoeud(Cnoeud &amp; oNOE) { oNOEStatut= oNOE.oNOEStatut; oNOEsequence = oNOE.NOEAffichersequence(); oNOEpere = oNOE.NOEAfficherpere(); oNOEfils.clear(); vector&lt;Cnoeud&gt;::iterator it; for(it=oNOE.NOEAfficherfils().begin();it!=oNOE.NOEAfficherfils().end();it++) { oNOEfils.push_back(*it); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload