autoPtr: Added assignment to pointer

This commit is contained in:
Henry Weller
2017-03-16 20:49:21 +00:00
parent 96c6c52017
commit 10c1d5697f
2 changed files with 12 additions and 2 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -125,6 +125,9 @@ public:
//- Return const object pointer
inline const T* operator->() const;
//- Take over the object pointer from parameter
inline void operator=(T*);
//- Take over the object pointer from parameter
inline void operator=(const autoPtr<T>&);
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,6 +190,13 @@ inline const T* Foam::autoPtr<T>::operator->() const
}
template<class T>
inline void Foam::autoPtr<T>::operator=(T* p)
{
reset(p);
}
template<class T>
inline void Foam::autoPtr<T>::operator=(const autoPtr<T>& ap)
{