PSCF v1.1
write.cpp
1/*
2* Util Package - C++ Utilities for Scientific Computation
3*
4* Copyright 2010 - 2017, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8
9#include "write.h"
10#include "Dbl.h"
11#include "Int.h"
12#include "Lng.h"
13#include "Bool.h"
14//#include "Str.h"
15
16namespace Util
17{
18
19 // Explicit specialization for double
20 template <> void write(std::ostream& out, double data)
21 { out << Dbl(data); }
22
23 // Explicit specialization for double
24 template <> void write(std::ostream& out, std::complex<double> data)
25 { out << Dbl(data.real()) << Dbl(data.imag()); }
26
27 // Explicit specialization for int
28 template <> void write(std::ostream& out, int data)
29 { out << Int(data); }
30
31 // Explicit specialization for long
32 template <> void write(std::ostream& out, long data)
33 { out << Lng(data); }
34
35 // Explicit specialization for bool
36 template <> void write(std::ostream& out, bool data)
37 { out << Bool(data); }
38
39}
Wrapper for an bool value, for formatted ostream output.
Definition: Bool.h:36
Wrapper for a double precision number, for formatted ostream output.
Definition: Dbl.h:40
Wrapper for an int, for formatted ostream output.
Definition: Int.h:37
Wrapper for a long int, for formatted ostream output.
Definition: Lng.h:36
Utility classes for scientific computation.
Definition: accumulators.mod:1
void write(std::ostream &out, double data)
Explicit specialization of write for double data.
Definition: write.cpp:20