aboutsummaryrefslogtreecommitdiff
path: root/src/archive.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/archive.h')
-rw-r--r--src/archive.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/archive.h b/src/archive.h
index a8ce53e..9ac3303 100644
--- a/src/archive.h
+++ b/src/archive.h
@@ -5,6 +5,7 @@
5#include <string> 5#include <string>
6#include "archival.h" 6#include "archival.h"
7#include "stream.h" 7#include "stream.h"
8#include <list>
8 9
9namespace Bu 10namespace Bu
10{ 11{
@@ -92,6 +93,34 @@ namespace Bu
92 return ar << dat; 93 return ar << dat;
93 } 94 }
94 } 95 }
96
97 template<typename T> Archive &operator<<( Archive &ar, std::list<T> &l )
98 {
99 typename std::list<T>::size_type num = l.size();
100 ar << num;
101 for( typename std::list<T>::const_iterator i = l.begin(); i != l.end();
102 i++ )
103 {
104 ar << *i;
105 }
106
107 return ar;
108 }
109
110 template<typename T> Archive &operator>>( Archive &ar, std::list<T> &l )
111 {
112 typename std::list<T>::size_type num;
113 ar >> num;
114
115 l.resize( num );
116 for( typename std::list<T>::const_iterator i = l.begin();
117 i != l.end(); i++ )
118 {
119 ar >> *i;
120 }
121
122 return ar;
123 }
95} 124}
96 125
97#endif 126#endif