ENH: add UPtrList swap() method

This commit is contained in:
Mark Olesen
2017-11-13 21:39:30 +01:00
parent 5a52dfa4f4
commit 00b1ecad60
2 changed files with 10 additions and 0 deletions

View File

@ -169,6 +169,9 @@ public:
//- Return true if the UPtrList is empty (ie, size() is zero)
inline bool empty() const;
//- Swap content with another UPtrList
inline void swap(UPtrList<T>& lst);
//- Return reference to the first element of the list
inline T& first();

View File

@ -39,6 +39,13 @@ inline bool Foam::UPtrList<T>::empty() const
}
template<class T>
inline void Foam::UPtrList<T>::swap(UPtrList<T>& lst)
{
ptrs_.swap(lst.ptrs_);
}
template<class T>
inline T& Foam::UPtrList<T>::first()
{