ludus::foundation::core::DefaultDeleter¶
Ludus Wiki · API overview · Browse API
Struct
Ordinary
delete destruction protocol for one complete, non-array object. The primary template declares
OrdinaryDeleteTag, which is what permits implicit UniquePtr<Derived> to UniquePtr<Base> conversion. Native specializations (for example the Wayland object deleters) supply their own operator() for incomplete external types and deliberately omit the marker: a type relationship never implies that two native protocols agree.| Template parameter | Description |
|---|---|
ElementType |
Owned object type. Must be complete, and must not be an array type, wherever
operator() is instantiated. |
Declared in modules/foundation/base/include/ludus/foundation/base/pointer.hpp
#include <ludus/foundation/base/pointer.hpp>
template <typename ElementType>
struct ludus::foundation::core::DefaultDeleter
Types¶
OrdinaryDeleteTag¶
using ludus::foundation::core::DefaultDeleter< ElementType >::OrdinaryDeleteTag = void
Identifies the audited ordinary-
delete protocol of the primary template. Declared in modules/foundation/base/include/ludus/foundation/base/pointer.hpp
Methods¶
operator()¶
void ludus::foundation::core::DefaultDeleter< ElementType >::operator()(ElementType *pointerOrNull) const noexcept
Destroys
pointerOrNull with ordinary delete. | Parameter | Description |
|---|---|
pointerOrNull |
Object created by ordinary non-array
new for exactly this protocol, or nullptr. UniquePtr never passes nullptr. |
Note
Instantiating this operator for an incomplete type is a compile error; define a PIMPL owner's destructor where its implementation is complete.
Declared in modules/foundation/base/include/ludus/foundation/base/pointer.hpp