diff --git a/C++/basic-calculator-iii.cpp b/C++/basic-calculator-iii.cpp index e9cb14484..2461788f6 100644 --- a/C++/basic-calculator-iii.cpp +++ b/C++/basic-calculator-iii.cpp @@ -39,10 +39,11 @@ class Solution { return operands.top(); } - void compute(stack& operands, stack& operators) { - const int64_t left = operands.top(); + template + void compute(stack& operands, stack& operators) { + const auto left = operands.top(); operands.pop(); - const int64_t right = operands.top(); + const auto right = operands.top(); operands.pop(); const char op = operators.top(); operators.pop();