User Tools

Site Tools


cpp:stl:intro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
cpp:stl:intro [2023/05/29 16:14]
gthanos
cpp:stl:intro [2023/05/30 11:02]
gthanos [Η κλάση Student]
Line 7: Line 7:
 ===== Η κλάση Student ===== ===== Η κλάση Student =====
  
-Στα παραδείγματα που ακολουθούν συχνά χρησιμοποιείται η παρακάτω κλάση Student.+Στα παραδείγματα που ακολουθούν  στις επόμενες ενότητες συχνά χρησιμοποιείται η παρακάτω κλάση //Student//.
  
 <code cpp Student.hpp> <code cpp Student.hpp>
Line 26: Line 26:
   friend std::ostream& operator<<(std::ostream& out, const Student & st);   friend std::ostream& operator<<(std::ostream& out, const Student & st);
   bool operator>(const Student& st) const;   bool operator>(const Student& st) const;
 +  bool operator<(const Student& st) const;
   Student& operator=(const Student& st);   Student& operator=(const Student& st);
 }; };
Line 73: Line 74:
 bool Student::operator>(const Student& st) const { bool Student::operator>(const Student& st) const {
   if(aem > st.aem)   if(aem > st.aem)
 +    return true;
 +  return false;
 +}
 +
 +bool Student::operator<(const Student& st) const {
 +  if(aem < st.aem)
     return true;     return true;
   return false;   return false;
cpp/stl/intro.txt · Last modified: 2023/05/30 18:30 by gthanos