From 77641f9b69b1f0e4b8e9988561ced94e5c343718 Mon Sep 17 00:00:00 2001 From: Krishna Vedala <7001608+kvedala@users.noreply.github.com> Date: Tue, 26 May 2020 18:15:00 -0400 Subject: [PATCH] use static variable to return reference for --- others/large_number.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/others/large_number.h b/others/large_number.h index 8ea8190b6..544682987 100644 --- a/others/large_number.h +++ b/others/large_number.h @@ -177,7 +177,7 @@ class large_number { * operator overload to increment (postfix) **/ large_number &operator++(int) { - large_number tmp(_digits); + static large_number tmp(_digits); ++(*this); return tmp; } @@ -212,7 +212,7 @@ class large_number { **/ template friend large_number &operator+(const large_number &a, const T &b) { - large_number c = a; + static large_number c = a; c += b; return c; }