Make Counted_number work

This commit is contained in:
Andreas Fabri 2022-10-27 11:43:05 +01:00
parent 015b927d2e
commit 7c50cf7821
1 changed files with 5 additions and 1 deletions

View File

@ -121,8 +121,12 @@ class Counted_number {
Counted_number() {}
//explicit Counted_number(int n) :m_rep(n){}
explicit Counted_number(NT n) :m_rep(n){}
Counted_number operator-() const
{inc_neg_count();return Counted_number(-m_rep);}
{
inc_neg_count(); NT neg = -m_rep; return Counted_number(neg);
}
Counted_number const & operator+=(Counted_number const &n)
{
inc_add_count();