50#define Foam_autoPtr_copyConstruct
51#define Foam_autoPtr_castOperator
91 template<
class... Args>
100 template<
class U,
class... Args>
127 #ifdef Foam_autoPtr_copyConstruct
162 T&
ref() {
return *ptr_; }
196 template<class... Args>
204 inline
T& operator*();
208 inline const
T& operator*() const;
212 inline
T* operator->();
216 inline const
T* operator->() const;
220 inline
T& operator()();
224 inline const
T& operator()() const;
230 explicit operator
bool() const
noexcept {
return bool(ptr_); }
233 operator const T*()
const noexcept {
return ptr_; }
236 operator T*()
noexcept {
return ptr_; }
243 #ifdef Foam_autoPtr_castOperator
244 operator const T&()
const {
return operator*(); }
246 operator const T&()
const =
delete;
267 inline void operator=(std::nullptr_t)
noexcept;
286 #ifndef Foam_autoPtr_nodeprecate_setMethod
#define Foam_autoPtr_castOperator
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void clear() noexcept
Same as reset(nullptr)
T & ref()
Return reference to the managed object without nullptr checking.
void swap(autoPtr< T > &other) noexcept
Swaps the managed object with other autoPtr.
T & operator*()
Return reference to the managed object.
bool empty() const noexcept
Deprecated(2020-07) True if the managed pointer is null.
T * get() noexcept
Return pointer to managed object without nullptr checking.
bool good() const noexcept
True if the managed pointer is non-null.
T * pointer
Pointer to type of object being managed.
T * release() noexcept
Release ownership and return the pointer.
void operator=(T *p)=delete
No copy assignment from plain pointer (uncontrolled access)
static autoPtr< T > NewFrom(Args &&... args)
Construct autoPtr from derived type with forwarding arguments.
constexpr autoPtr() noexcept
Construct with no managed pointer.
bool valid() const noexcept
Identical to good(), or bool operator.
void reset(autoPtr< T > &&other) 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.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
T * ptr() noexcept
Same as release().
autoPtr(const autoPtr< T > &ap) noexcept
A move construct disguised as a copy construct (transfers ownership)
void set(T *p) noexcept
Deprecated(2018-02) Identical to reset().
T element_type
Type of object being managed.
~autoPtr() noexcept
Deletes the managed pointer.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Foam::argList args(argc, argv)
Includes some standard C++ headers, defines global macros and templates used in multiple places by Op...
#define FOAM_DEPRECATED_FOR(since, replacement)