(list)+general style change, use unary switches for checking null
This commit is contained in:
2
list.cpp
2
list.cpp
@@ -45,7 +45,7 @@ List<T> *append(List<T> *lst, T value)
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
std::ostream& operator<<(std::ostream& ostream, const List<T> *lst)
|
std::ostream& operator<<(std::ostream& ostream, const List<T> *lst)
|
||||||
{
|
{
|
||||||
if (lst == NULL)
|
if (!lst)
|
||||||
return ostream;
|
return ostream;
|
||||||
ostream << "|" << lst->value << lst->next;
|
ostream << "|" << lst->value << lst->next;
|
||||||
return ostream;
|
return ostream;
|
||||||
|
|||||||
Reference in New Issue
Block a user