ENH: UIndirectList: assignment from UIndirectList

This commit is contained in:
mattijs
2011-11-18 11:25:57 +00:00
parent bd7e216566
commit b723a6aa65
2 changed files with 22 additions and 0 deletions

View File

@ -112,6 +112,9 @@ public:
//- Assignment from UList of addressed elements
inline void operator=(const UList<T>&);
//- Assignment from UIndirectList of addressed elements
inline void operator=(const UIndirectList<T>&);
//- Assignment of all entries to the given value
inline void operator=(const T&);

View File

@ -144,6 +144,25 @@ inline void Foam::UIndirectList<T>::operator=(const UList<T>& ae)
}
template<class T>
inline void Foam::UIndirectList<T>::operator=(const UIndirectList<T>& ae)
{
if (addressing_.size() != ae.size())
{
FatalErrorIn("UIndirectList<T>::operator=(const UIndirectList<T>&)")
<< "Addressing and list of addressed elements "
"have different sizes: "
<< addressing_.size() << " " << ae.size()
<< abort(FatalError);
}
forAll(addressing_, i)
{
completeList_[addressing_[i]] = ae[i];
}
}
template<class T>
inline void Foam::UIndirectList<T>::operator=(const T& t)
{