diff options
-rw-r--r-- | list.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -4,6 +4,7 @@ */ #include <cstdio> +#include <iostream> #include <cstdlib> template <typename T> @@ -34,6 +35,15 @@ List<T> *append(List<T> *lst, T value) return lst; } +template <typename T> +std::ostream& operator<<(std::ostream& ostream, const List<T> *lst) +{ + if (lst == NULL) + return ostream; + ostream << "|" << lst->value << lst->next; + return ostream; +} + int main(void) { return 0; |