aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src
diff options
context:
space:
mode:
authorschnetter <>2004-05-27 10:26:00 +0000
committerschnetter <>2004-05-27 10:26:00 +0000
commitf75ac4f8e60c1d73d610d00c18078dbe6ea740c3 (patch)
tree8a33cc6e39839ef7d43dfb4464d4439029ef1762 /Carpet/CarpetLib/src
parent4b06928bddf6ed5146716a82078b1660b922dd7f (diff)
New function
darcs-hash:20040527102609-07bb3-8a80ea8a94dc7739da7e482ae925beb4a01585c3.gz
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r--Carpet/CarpetLib/src/vect.hh7
1 files changed, 6 insertions, 1 deletions
diff --git a/Carpet/CarpetLib/src/vect.hh b/Carpet/CarpetLib/src/vect.hh
index f540fa029..a49c55978 100644
--- a/Carpet/CarpetLib/src/vect.hh
+++ b/Carpet/CarpetLib/src/vect.hh
@@ -1,4 +1,4 @@
-// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.hh,v 1.27 2004/05/04 22:12:07 schnetter Exp $
+// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.hh,v 1.28 2004/05/27 12:26:09 schnetter Exp $
#ifndef VECT_HH
#define VECT_HH
@@ -114,6 +114,11 @@ public:
return vect(x, y, z, t);
}
+ /** Treat a constant pointer as a reference to a constant vector. */
+ static const vect& ref (const T* const x) {
+ return *(const vect*)x;
+ }
+
/** Treat a pointer as a reference to a vector. */
static vect& ref (T* const x) {
return *(vect*)x;