Skip to content

Commit

Permalink
Update basic-calculator-iii.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 authored Jan 24, 2018
1 parent 5d93c2d commit 188d8db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions C++/basic-calculator-iii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ class Solution {
return operands.top();
}

void compute(stack<int64_t>& operands, stack<char>& operators) {
const int64_t left = operands.top();
template<typename T>
void compute(stack<T>& operands, stack<char>& 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();
Expand Down

0 comments on commit 188d8db

Please sign in to comment.