| 13 | // Serialize data t to an STL ostream. |
| 14 | template <class T> |
| 15 | void to_stream(const T& t, std::ostream& stream) { |
| 16 | StreamOutputBuffer ob(stream); |
| 17 | ob << t; |
| 18 | ob.flush(); |
| 19 | } |
| 20 | |
| 21 | // Parse from an STL istream and save to the data t passed in. |
| 22 | // Recommended for repeated use inside a loop. |