diff --git a/list.cpp b/list.cpp index 937e7a7..009ed9a 100644 --- a/list.cpp +++ b/list.cpp @@ -4,6 +4,7 @@ */ #include +#include #include template @@ -34,6 +35,15 @@ List *append(List *lst, T value) return lst; } +template +std::ostream& operator<<(std::ostream& ostream, const List *lst) +{ + if (lst == NULL) + return ostream; + ostream << "|" << lst->value << lst->next; + return ostream; +} + int main(void) { return 0;