-unmarshall& operator>>(unmarshall &, bool &);
-unmarshall& operator>>(unmarshall &, unsigned char &);
-unmarshall& operator>>(unmarshall &, char &);
-unmarshall& operator>>(unmarshall &, unsigned short &);
-unmarshall& operator>>(unmarshall &, short &);
-unmarshall& operator>>(unmarshall &, unsigned int &);
-unmarshall& operator>>(unmarshall &, int &);
-unmarshall& operator>>(unmarshall &, unsigned long long &);
-unmarshall& operator>>(unmarshall &, std::string &);
-
-template <class C> unmarshall &
-operator>>(unmarshall &u, std::vector<C> &v)
-{
- unsigned n;
- u >> n;
- v.clear();
- while (n--) {
- C c;
- u >> c;
- v.push_back(c);
- }
- return u;
-}
-
-template <class A, class B> unmarshall &
-operator>>(unmarshall &u, std::map<A,B> &d) {
- unsigned n;
- u >> n;
- d.clear();
- while (n--) {
- A a;
- B b;
- u >> a >> b;
- d[a] = b;
- }
+template <class A> unmarshall & operator>>(unmarshall &u, A &x) {
+ unsigned n = u.grab<unsigned>();
+ x.clear();
+ while (n--)
+ x.emplace_back(u.grab<typename A::value_type>());