Skip to content
Snippets Groups Projects
Commit 2c31e665 authored by Henry Weller's avatar Henry Weller
Browse files

autoPtr: Added assignment to pointer

parent 9d2ba297
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -125,6 +125,9 @@ public: ...@@ -125,6 +125,9 @@ public:
//- Return const object pointer //- Return const object pointer
inline const T* operator->() const; inline const T* operator->() const;
//- Take over the object pointer from parameter
inline void operator=(T*);
//- Take over the object pointer from parameter //- Take over the object pointer from parameter
inline void operator=(const autoPtr<T>&); inline void operator=(const autoPtr<T>&);
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -190,6 +190,13 @@ inline const T* Foam::autoPtr<T>::operator->() const ...@@ -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> template<class T>
inline void Foam::autoPtr<T>::operator=(const autoPtr<T>& ap) inline void Foam::autoPtr<T>::operator=(const autoPtr<T>& ap)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment