public method hidden by protected one

Francois Coulon francois.coulon@gmail.com
Mon Nov 26 11:42:00 GMT 2007


We have thos two declarations in a class :

public:
    const DonneesCP & getDonneesCP() const ;

protected:
   DonneesCP &getDonneesCP();

We try to call the public one from outside the class, we have this error :

/vobs/ERATO/SMET/SAD/PUB/Linux-x86_64/include/DonneesCP/InterfaceDonneesCP.hpp:320:
error: « erato::DonneesCP& erato::InterfaceDonneesCP::getDonneesCP() »
is protected
/vobs/ERATO/APP/OTDA/TUFA/src/TUFA/tuf.cpp:117: error: within this context

If we remove the protected method, the error dissappears.

Is this normal behaviour or not ?

Thanks in advance



More information about the Gcc-help mailing list