aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/data.hh
diff options
context:
space:
mode:
authorSteve White <swhite@aei.mpg.de>2005-08-09 09:33:00 +0000
committerSteve White <swhite@aei.mpg.de>2005-08-09 09:33:00 +0000
commit9bfd4f4d2639ac9c6e91ae2dde24bf5b7c1858e0 (patch)
treeaaae717fd71dccf18e3e301a089bf1903dc88098 /Carpet/CarpetLib/src/data.hh
parent1cb26848ad81cec482dd8124f9ee6cf02e4f2e25 (diff)
CarpetLib: give data an << operator
Added a ostream & << operator for the data class. Made an explicit instantiation for CCTK_REAL. Usually the amount of data renders such an operator useless, but in test programs it is handy to be able to just print the data values. darcs-hash:20050809093318-90671-dd30c55dc8757efa96a9bfbe90a48ff445e26f07.gz
Diffstat (limited to 'Carpet/CarpetLib/src/data.hh')
-rw-r--r--Carpet/CarpetLib/src/data.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/data.hh b/Carpet/CarpetLib/src/data.hh
index e1e107fb4..663c58843 100644
--- a/Carpet/CarpetLib/src/data.hh
+++ b/Carpet/CarpetLib/src/data.hh
@@ -17,7 +17,7 @@
using namespace std;
-
+#include <iosfwd>
// A distributed multi-dimensional array
template<typename T>
@@ -162,8 +162,12 @@ private:
void Check_that_the_times_are_consistent ( const vector<CCTK_REAL> & times,
const CCTK_REAL time );
+ friend ostream & operator << <T> ( ostream & os, const data<T> & d );
};
+template<typename T>
+ostream & operator << ( ostream & os, const data<T> & d );
+
// Declare a specialisation
@@ -176,5 +180,4 @@ void data<CCTK_REAL8>
const int order_time);
-
#endif // DATA_HH