void add(Book currentBook) { //Book myBook = Book(bookName, bookThickness); if (shelfSpace < currentBook.getBookLength()) { int temp = shelf.back().getBookLength(); shelfSpace += temp; shelf.pop_back(); add(currentBook); } else { shelf.push_front(currentBook); shelfSpace -= currentBook.getBookLength(); } }
bool operator ==(const Book& other) { if(this->getTitle()==other.getTitle()&&this->getBookLength() ==other.getBookLength()) { return true; } else return false; }