I am little bit confused with this code. main.cpp
int emptyApartments(const Apartment* apt, int num) {
   int sum = 0;
   for(int i = 0; i < num; i++) {
      sum += apt[i] && ~apt[i]; //this line is calling which functions?
   }
   return sum;
}
I am not sure line 4(main.cpp) is calling which functions from code below:
  Apartment(int number, double balance);
  void setEmpty();
  std::ostream& display()const;
  operator bool()const;
  operator int()const;
  operator double()const;
  bool operator~()const;
  Apartment& operator+=(double rent);
  Apartment& operator-=(double rent);
  Apartment& operator<<(Apartment& other);
  Apartment& operator>>(Apartment& other);
  Apartment& operator=(int number);
  Apartment& operator=(Apartment& other);
   
  friend double operator+(const Apartment& left, const Apartment& right);
  friend double operator+=(double& value, const Apartment& add);
 
     
    