First test good
This commit is contained in:
@@ -231,7 +231,7 @@ LinkedListErr LinkedList<T>::set(size_t index, const T& val) {
|
||||
|
||||
template <LinkedListSupported T>
|
||||
LinkedListErr LinkedList<T>::insert(size_t index, const T& value) {
|
||||
if (this->is_empty()) {
|
||||
if (this->is_empty() && index == 0) {
|
||||
return this->append(value);
|
||||
}
|
||||
|
||||
@@ -425,5 +425,9 @@ size_t LinkedList<T>::len() {
|
||||
return this->size;
|
||||
}
|
||||
|
||||
template <LinkedListSupported T>
|
||||
bool LinkedList<T>::is_empty() {
|
||||
return this->len() < 1;
|
||||
}
|
||||
|
||||
#endif // !
|
||||
|
||||
Reference in New Issue
Block a user