Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
3565b549
Commit
3565b549
authored
May 23, 2016
by
Henry Weller
Browse files
tmp: Added 'move' constructor to simplify return of unchanged 'tmp' arguments.
parent
0a43d605
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/memory/tmp/tmp.H
View file @
3565b549
...
...
@@ -92,6 +92,9 @@ public:
//- Construct copy and increment reference count
inline
tmp
(
const
tmp
<
T
>&
);
//- Construct copy moving content, does not increment reference count
inline
tmp
(
const
tmp
<
T
>&&
);
//- Construct copy transferring content of temporary if required
inline
tmp
(
const
tmp
<
T
>&
,
bool
allowTransfer
);
...
...
src/OpenFOAM/memory/tmp/tmpI.H
View file @
3565b549
...
...
@@ -91,6 +91,19 @@ inline Foam::tmp<T>::tmp(const tmp<T>& t)
}
template
<
class
T
>
inline
Foam
::
tmp
<
T
>::
tmp
(
const
tmp
<
T
>&&
t
)
:
type_
(
t
.
type_
),
ptr_
(
t
.
ptr_
)
{
if
(
isTmp
())
{
t
.
ptr_
=
0
;
}
}
template
<
class
T
>
inline
Foam
::
tmp
<
T
>::
tmp
(
const
tmp
<
T
>&
t
,
bool
allowTransfer
)
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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