Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -157,6 +157,33 @@ void Foam::UPtrList<T>::shuffle(const labelUList& newToOld)
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class T>
|
||||
template<class T2>
|
||||
Foam::UPtrList<T2> Foam::UPtrList<T>::convert()
|
||||
{
|
||||
UPtrList<T2> result(size());
|
||||
forAll(ptrs_, i)
|
||||
{
|
||||
result.set(i, ptrs_[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
template<class T2>
|
||||
Foam::UPtrList<const T2> Foam::UPtrList<T>::convert() const
|
||||
{
|
||||
UPtrList<const T2> result(size());
|
||||
forAll(ptrs_, i)
|
||||
{
|
||||
result.set(i, ptrs_[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "UPtrListIO.C"
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -150,6 +150,17 @@ public:
|
||||
void shuffle(const labelUList& newToOld);
|
||||
|
||||
|
||||
// Conversion
|
||||
|
||||
//- Convert to list of different pointer type
|
||||
template<class T2>
|
||||
UPtrList<T2> convert();
|
||||
|
||||
//- Convert to list of different pointer type
|
||||
template<class T2>
|
||||
UPtrList<const T2> convert() const;
|
||||
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Return element const reference
|
||||
|
||||
Reference in New Issue
Block a user