60 reset(other.release());
65template<
class... Args>
69 ptr_ =
new T(std::forward<Args>(
args)...);
86template<
class... Args>
106 <<
"unallocated autoPtr of type " <<
typeid(
T).
name()
116 return const_cast<autoPtr<T>*
>(
this)->
operator*();
126 <<
"unallocated autoPtr of type " <<
typeid(
T).
name()
136 return const_cast<autoPtr<T>*
>(
this)->operator->();
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
T & emplace(Args &&... args)
Reset with emplace construction. Return reference to the new content.
void swap(autoPtr< T > &other) noexcept
Swaps the managed object with other autoPtr.
T & operator*()
Return reference to the managed object.
T * operator->()
Dereferences (non-const) pointer to the managed object.
T & operator()()
Return reference to the object data.
T * release() noexcept
Release ownership and return the pointer.
constexpr autoPtr() noexcept
Construct with no managed pointer.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
autoPtr< T > clone(Args &&... args) const
Copy construct by invoking clone on underlying managed object.
Function1 * ptr() noexcept
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Foam::argList args(argc, argv)