added xfer<T>::null()

This commit is contained in:
Mark Olesen
2008-10-24 10:13:48 +02:00
parent 8ffa04c892
commit 2023ab6e0d
2 changed files with 15 additions and 0 deletions

View File

@ -102,6 +102,11 @@ public:
inline ~xfer();
// Member Functions
//- Return a null object reference
inline static const xfer<T>& null();
// Member Operators
//- Transfer the contents into the object

View File

@ -77,6 +77,16 @@ inline Foam::xfer<T>::~xfer()
}
// * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * //
template<class T>
inline const Foam::xfer<T>& Foam::xfer<T>::null()
{
xfer<T>* nullPtr = reinterpret_cast<xfer<T>*>(0);
return *nullPtr;
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T>