tmp: Added 'move' constructor to simplify return of unchanged 'tmp' arguments.
This commit is contained in:
parent
0a43d60567
commit
3565b5491f
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
:
|
||||
|
Loading…
Reference in New Issue
Block a user