Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
8e040421
Commit
8e040421
authored
May 21, 2016
by
Henry Weller
Browse files
tmp: Allow '.ref()' for const 'tmp'
const-ness of the stored object is checked at run-time.
parent
f73a8e61
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/memory/tmp/tmp.H
View file @
8e040421
...
@@ -124,7 +124,7 @@ public:
...
@@ -124,7 +124,7 @@ public:
//- Return non-const reference or generate a fatal error
//- Return non-const reference or generate a fatal error
// if the object is const.
// if the object is const.
inline
T
&
ref
();
inline
T
&
ref
()
const
;
//- Return tmp pointer for reuse.
//- Return tmp pointer for reuse.
// Returns a clone if the object is not a temporary
// Returns a clone if the object is not a temporary
...
...
src/OpenFOAM/memory/tmp/tmpI.H
View file @
8e040421
...
@@ -158,7 +158,7 @@ inline Foam::word Foam::tmp<T>::typeName() const
...
@@ -158,7 +158,7 @@ inline Foam::word Foam::tmp<T>::typeName() const
template
<
class
T
>
template
<
class
T
>
inline
T
&
Foam
::
tmp
<
T
>::
ref
()
inline
T
&
Foam
::
tmp
<
T
>::
ref
()
const
{
{
if
(
isTmp
())
if
(
isTmp
())
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment