diff --git a/src/OpenFOAM/memory/tmp/tmp.H b/src/OpenFOAM/memory/tmp/tmp.H index 28d6fb50f3..6a145158a7 100644 --- a/src/OpenFOAM/memory/tmp/tmp.H +++ b/src/OpenFOAM/memory/tmp/tmp.H @@ -124,7 +124,7 @@ public: //- Return non-const reference or generate a fatal error // if the object is const. - inline T& ref(); + inline T& ref() const; //- Return tmp pointer for reuse. // Returns a clone if the object is not a temporary diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H index b1add8e8c3..e08214bcd1 100644 --- a/src/OpenFOAM/memory/tmp/tmpI.H +++ b/src/OpenFOAM/memory/tmp/tmpI.H @@ -158,7 +158,7 @@ inline Foam::word Foam::tmp::typeName() const template -inline T& Foam::tmp::ref() +inline T& Foam::tmp::ref() const { if (isTmp()) {