- Book& operator>>(uint64_t& n) { n = read_integer(8); return *this; }
- Book& operator>>(uint16_t& n) { n = (uint16_t)read_integer(2); return *this; }
- void operator>>(BookEntry& e) { *this >> e.key >> e.move >> e.count >> e.n >> e.sum; }
+ // read n chars from the file stream and converts them in an
+ // integer number. Integers are stored with highest byte first.
+ template<int n> uint64_t get_int();
+
+ template<typename T>
+ Book& operator>>(T& n) { n = (T)get_int<sizeof(T)>(); return *this; }