tmp: Allow '.ref()' for const 'tmp'
const-ness of the stored object is checked at run-time.
This commit is contained in:
@ -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
|
||||
|
||||
@ -158,7 +158,7 @@ inline Foam::word Foam::tmp<T>::typeName() const
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T& Foam::tmp<T>::ref()
|
||||
inline T& Foam::tmp<T>::ref() const
|
||||
{
|
||||
if (isTmp())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user