]> Dogcows Code - chaz/yoink/blob - src/stlplus/persistence/persistent_complex.tpp
testing new non-autotools build system
[chaz/yoink] / src / stlplus / persistence / persistent_complex.tpp
1 ////////////////////////////////////////////////////////////////////////////////
2
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
7
8 ////////////////////////////////////////////////////////////////////////////////
9
10 namespace stlplus
11 {
12
13 ////////////////////////////////////////////////////////////////////////////////
14
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)
18 {
19 dump_fn(context,data.real());
20 dump_fn(context,data.imag());
21 }
22
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)
26 {
27 T re, im;
28 restore_fn(context,re);
29 restore_fn(context,im);
30 data = std::complex<T>(re, im);
31 }
32
33 ////////////////////////////////////////////////////////////////////////////////
34
35 } // end namespace stlplus
This page took 0.02932 seconds and 4 git commands to generate.