From 188d8dbec87a82c43b2e6986c13e77d5bfaa7d6d Mon Sep 17 00:00:00 2001 From: kamyu Date: Thu, 25 Jan 2018 00:24:09 +0800 Subject: [PATCH] Update basic-calculator-iii.cpp --- C++/basic-calculator-iii.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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();