C++ (Qt)class Hardware{private: Status m_status;};
C++ (Qt)class Hardware{public: const Status &status() const { return m_status; } private: Status m_status;};
C++ (Qt)class Hardware{public: const Status &status() const { Status status; status.device1( m_device1->status() ); status.device2( m_device2->status() ); return status; }};
class SomeCrap{public: double GetSomeShit() const;private: double CalculateSomeShit() const; double m_shitValue;};
double SomeCrap::GetSomeShit() const{ double result = 0; // some crap result += CalculateSomeShit(); // another crap return result;}void SomeCrap::CalculateSomeShit() const{ return sqrt(m_shitValue * 0.001);}
class SomeNewCrap : public SomeCrap{public:private: double CalculateSomeShit() const; // таак... а ведь CalculateSomeShit мы не можем переопределить :(};
C++ (Qt)const QBrush & QPainter::brush() constReturns the painter's current brush.