PSCF v1.1
write.h
1#ifndef UTIL_WRITE_H
2#define UTIL_WRITE_H
3
4/*
5* Util Package - C++ Utilities for Scientific Computation
6*
7* Copyright 2010 - 2017, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <iostream>
12#include <complex>
13
14namespace Util
15{
16
41 template <typename Type>
42 void write(std::ostream& out, Type data);
43
47 template <> void write(std::ostream& out, double data);
48
52 template <> void write(std::ostream& out, std::complex<double> data);
53
57 template <> void write(std::ostream& out, int data);
58
62 template <> void write(std::ostream& out, long data);
63
67 template <> void write(std::ostream& out, bool data);
68
72 template <> void write(std::ostream& out, std::string data);
73
74 // Template definition
75
76 /*
77 * Primary template.
78 */
79 template <typename Type>
80 inline void write(std::ostream& out, Type data)
81 { out << data; }
82
83}
84#endif
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