SubList: added void operator=(const T&) for convenience

This commit is contained in:
Mark Olesen
2008-11-20 23:02:14 +01:00
parent a11386e6ba
commit 7bbe6c9d10
2 changed files with 12 additions and 2 deletions

View File

@ -87,6 +87,9 @@ public:
//- Allow cast to a const List<T>&
inline operator const Foam::List<T>&() const;
//- Assignment of all entries to the given value
inline void operator=(const T&);
};

View File

@ -54,7 +54,7 @@ inline Foam::SubList<T>::SubList
# ifdef FULLDEBUG
// Artificially allowing the start of a zero-sized subList to be
// one past the end of the original list.
// one past the end of the original list.
if (subSize > 0)
{
list.checkStart(startIndex);
@ -73,7 +73,7 @@ inline Foam::SubList<T>::SubList
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T>
const Foam::SubList<T>& Foam::SubList<T>::null()
inline const Foam::SubList<T>& Foam::SubList<T>::null()
{
SubList<T>* nullPtr = reinterpret_cast<SubList<T>*>(NULL);
return *nullPtr;
@ -89,4 +89,11 @@ inline Foam::SubList<T>::operator const Foam::List<T>&() const
}
template<class T>
inline void Foam::SubList<T>::operator=(const T& t)
{
UList<T>::operator=(t);
}
// ************************************************************************* //