1 ////////////////////////////////////////////////////////////////////////////////
3 // Author: Andy Rushton
4 // Copyright: (c) Southampton University 1999-2004
5 // (c) Andy Rushton 2004-2009
6 // License: BSD License, see ../docs/license.html
8 ////////////////////////////////////////////////////////////////////////////////
13 ////////////////////////////////////////////////////////////////////////////////
15 template<typename T, typename D>
16 void dump_complex(dump_context& context, const std::complex<T>& data, D dump_fn)
17 throw(persistent_dump_failed)
19 dump_fn(context,data.real());
20 dump_fn(context,data.imag());
23 template<typename T, typename R>
24 void restore_complex(restore_context& context, std::complex<T>& data, R restore_fn)
25 throw(persistent_restore_failed)
28 restore_fn(context,re);
29 restore_fn(context,im);
30 data = std::complex<T>(re, im);
33 ////////////////////////////////////////////////////////////////////////////////
35 } // end namespace stlplus