Skip to content

Commit 7737505

Browse files
Fixed First and Last return type
1 parent 3e0f209 commit 7737505

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ListLib.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class List
3232
bool Contains(T item);
3333
size_t IndexOf(T item);
3434

35-
void First();
36-
void Last();
35+
T& First();
36+
T& Last();
3737

3838
void Add(T item);
3939
void AddRange(T* items, size_t numItems);
@@ -116,13 +116,13 @@ size_t List<T>::Count() const
116116
}
117117

118118
template <typename T>
119-
void List<T>::First()
119+
T& List<T>::First()
120120
{
121121
return _items[0];
122122
}
123123

124124
template <typename T>
125-
void List<T>::Last()
125+
T& List<T>::Last()
126126
{
127127
return _items[_count - 1];
128128
}

0 commit comments

Comments
 (0)