Website Summary Files Commits Branches @commit @diff @stats
path: root / src / List / List.cpp
diff options
context:
space:
mode:
1 files changed, 6 insertions, 0 deletions
-rw-r--r--src/List/List.cpp6
diff --git a/src/List/List.cpp b/src/List/List.cpp
index 5a0e1f2..1f3540f 100644
--- a/src/List/List.cpp
+++ b/src/List/List.cpp
@@ -77,6 +77,12 @@ std::istream& List<T>::read(std::istream& istr) {
template <class T>
std::ostream& List<T>::write(std::ostream& ostr) const {
+ ostr.write((const char*)&length, sizeof(length));
+ ostr.write((const char*)&count, sizeof(count));
+
+ for (int i = 0; i < count; i++)
+ elements[i].write(ostr); // disgusting
+
return ostr;
}