aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-07 14:20:57 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2002-04-07 14:20:57 +0000
commite8237486091a9fe61d970422d5ecbe15dc07119b (patch)
tree820035a3f99e476c11b40f32c2bb5071ccb95b68 /src
parent6b4191b3208a563102e5278b49c4c4a0e2092704 (diff)
change gridfn() and ghosted_gridfn() fns to return const references
for the rvalue case --> this makes them usable as the operand of a unary-& (address-of) expression git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@459 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src')
-rw-r--r--src/patch/grid.hh21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/patch/grid.hh b/src/patch/grid.hh
index a8220f4..b548297 100644
--- a/src/patch/grid.hh
+++ b/src/patch/grid.hh
@@ -314,33 +314,34 @@ public:
//
// ***** gridfns *****
//
+ // ... all these functions (even the rvalue ones) must return
+ // references, to allow using gridfn(...) as the operand
+ // of a unary & (address-of) operator
+ //
public:
-
// access to nominal-grid gridfn data
- // ... rvalue (may be slightly faster since it's a const function
- // and it returns by value rather than reference
- fp gridfn(int gfn, int irho, int isigma) const
+ // ... rvalue
+ const fp& gridfn(int gfn, int irho, int isigma) const
{
assert(gridfn_data_ != NULL);
return (*gridfn_data_)(gfn, irho, isigma);
}
- // ... lvalue (must return a reference)
- fp& gridfn(int gfn, int irho, int isigma)
+ // ... lvalue
+ fp& gridfn(int gfn, int irho, int isigma)
{
assert(gridfn_data_ != NULL);
return (*gridfn_data_)(gfn, irho, isigma);
}
// access to ghosted-grid gridfn data
- // ... rvalue (may be slightly faster since it's a const function
- // and it returns by value rather than reference
- fp ghosted_gridfn(int gfn, int irho, int isigma) const
+ // ... rvalue
+ const fp& ghosted_gridfn(int gfn, int irho, int isigma) const
{
assert(gridfn_data_ != NULL);
return (*ghosted_gridfn_data_)(gfn, irho, isigma);
}
// ... lvalue (must return a reference)
- fp& ghosted_gridfn(int gfn, int irho, int isigma)
+ fp& ghosted_gridfn(int gfn, int irho, int isigma)
{
assert(gridfn_data_ != NULL);
return (*ghosted_gridfn_data_)(gfn, irho, isigma);