<commit_before>#include "ex14_15.h"

std::istream& operator>>(std::istream& in, Book& book)
{
    in >> book.no_ >> book.name_ >> book.author_ >> book.pubdate_ >>
        book.number_;
    if (!in) book = Book();
    return in;
}

std::ostream& operator<<(std::ostream& out, const Book& book)
{
    out << book.no_ << " " << book.name_ << " " << book.author_ << " "
        << book.pubdate_ << " " << book.number_ << std::endl;
    return out;
}

bool operator==(const Book& lhs, const Book& rhs)
{
    return lhs.no_ == rhs.no_;
}

bool operator!=(const Book& lhs, const Book& rhs)
{
    return !(lhs == rhs);
}

bool operator<(const Book& lhs, const Book& rhs)
{
    return lhs.no_ < rhs.no_;
}

bool operator>(const Book& lhs, const Book& rhs)
{
    return rhs < lhs;
}

Book& Book::operator+=(const Book& rhs)
{
    if (rhs == *this) this->number_ += rhs.number_;

    return *this;
}

Book operator+(const Book& lhs, const Book& rhs)
{
    Book book = lhs;
    book += rhs;
    return book;
}
<commit_msg>Update ex14_15.cpp<commit_after>#include <iostream>
#include "ex14_15.h"

Book& Book::operator+=(const Book& rhs)
{
    if(rhs==*this)
        number_+=rhs.number_;
    return *this;
}

std::istream& operator>>(std::istream& is, Book& book)
{
    is >> book.no_ >> book.name_ >> book.author_ >> book.pubdate_>>book.number_;
    if(!is)
        book=Book();
    return is;
}

std::ostream& operator<<(std::ostream& os, const Book& book)
{
    os<<book.no_<<" "<<book.name_<<" "<<book.author_<<" "<<book.pubdate_<<" "<<book.number_;
    return os;
}

bool operator==(const Book& lhs, const Book& rhs)
{
    return lhs.no_==rhs.no_;
}

bool operator!=(const Book& lhs, const Book& rhs)
{
    return !(lhs==rhs);
}

bool operator<(const Book& lhs, const Book& rhs)
{
    return lhs.no_<rhs.no_;
}

bool operator>(const Book& lhs, const Book& rhs)
{
    return rhs<lhs;
}

Book operator+(const Book& lhs, const Book&rhs)
{
    Book book=lhs;
    book+=rhs;
    return book;
}

{'fraction_non_alphanumeric': 0.18475517415446743, 'fraction_numerical': 0.006057546693589096, 'mean_word_length': 3.4044444444444446, 'pattern_counts': {'":': 0, '<': 52, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4577538', 'n_tokens_mistral': 762, 'n_tokens_neox': 764, 'n_words': 186}