Commit 2c31e665 authored by Henry Weller's avatar Henry Weller
Browse files

autoPtr: Added assignment to pointer

parent 9d2ba297
......@@ -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>&);
};
......
......@@ -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)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment