Changeset View
Changeset View
Standalone View
Standalone View
src/amount.h
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | constexpr int64_t operator/(const Amount b) const { | ||||
return amount / b.amount; | return amount / b.amount; | ||||
} | } | ||||
constexpr Amount operator/(const int64_t b) const { | constexpr Amount operator/(const int64_t b) const { | ||||
return Amount(amount / b); | return Amount(amount / b); | ||||
} | } | ||||
constexpr Amount operator/(const int b) const { return Amount(amount / b); } | constexpr Amount operator/(const int b) const { return Amount(amount / b); } | ||||
// DO NOT IMPLEMENT | // DO NOT IMPLEMENT | ||||
constexpr Amount operator/(const double b) const = delete; | constexpr Amount operator/(const double b) const = delete; | ||||
constexpr Amount operator%(const int64_t b) const { | |||||
return Amount(amount % b); | |||||
} | |||||
constexpr Amount operator%(const int b) const { return Amount(amount % b); } | |||||
// DO NOT IMPLEMENT | |||||
constexpr Amount operator%(const double b) const = delete; | |||||
// ostream support | // ostream support | ||||
friend std::ostream &operator<<(std::ostream &stream, const Amount &ca) { | friend std::ostream &operator<<(std::ostream &stream, const Amount &ca) { | ||||
return stream << ca.amount; | return stream << ca.amount; | ||||
} | } | ||||
std::string ToString() const; | std::string ToString() const; | ||||
// serialization support | // serialization support | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |