Skip to content

Commit 2213b45

Browse files
committed
changed a type of parameter and return type
1 parent 7f7124c commit 2213b45

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Stack/stack_impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void Stack<T>::Pop()
3232
}
3333

3434
template<class T>
35-
void Stack<T>::Push(T data)
35+
void Stack<T>::Push(T &data)
3636
{
3737
if (Empty())
3838
Init();
@@ -46,7 +46,7 @@ void Stack<T>::Push(T data)
4646
}
4747

4848
template<class T>
49-
T Stack<T>::Top()
49+
T& Stack<T>::Top()
5050
{
5151
return buf_[top_];
5252
}

Stack/stack_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class Stack
1212
~Stack();
1313

1414
void Pop();
15-
void Push(T data);
16-
T Top();
15+
void Push(T& data);
16+
T& Top();
1717

1818
bool Empty();
1919

0 commit comments

Comments
 (0)