60 reset(other.release());
76 template<
class... Args>
96 <<
"unallocated autoPtr of type " <<
typeid(
T).
name()
106 return const_cast<autoPtr<T>*
>(
this)->
operator*();
116 <<
"unallocated autoPtr of type " <<
typeid(
T).
name()
126 return const_cast<autoPtr<T>*
>(
this)->operator->();
void swap(autoPtr< T > &other) noexcept
Swaps the managed object with other autoPtr.
T & operator*()
Return reference to the managed object.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
errorManip< error > abort(error &err)
T * release() noexcept
Release ownership and return the pointer.
T * operator->()
Dereferences (non-const) pointer to the managed object.
autoPtr< T > clone(Args &&... args) const
Copy construct by invoking clone on underlying managed object.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
T & operator()()
Return reference to the object data.
Foam::argList args(argc, argv)