ORIGINAL
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
original::deleterBase< TYPE, DERIVED > Class Template Referenceabstract

Base class for deleters defining the deletion policy interface. More...

#include <deleter.h>

Collaboration diagram for original::deleterBase< TYPE, DERIVED >:
Collaboration graph

Public Types

template<typename T >
using rebound_deleter = DERIVED< T >
 Rebound deleter type for type transformation scenarios.
 

Public Member Functions

constexpr deleterBase () noexcept=default
 Default constructor.
 
virtual ~deleterBase ()=0
 Pure virtual destructor.
 
virtual void operator() (const TYPE *ptr) const noexcept=0
 Deletion operator.
 

Detailed Description

template<typename TYPE, template< typename > class DERIVED>
class original::deleterBase< TYPE, DERIVED >

Base class for deleters defining the deletion policy interface.

Base class for array deleters.

Template Parameters
TYPEType of the resource.
DERIVEDCRTP Derived deleter type.

This class serves as the base for all specific deleters and provides a pure virtual function operator() to handle resource deletion. Since this is an abstract class, it cannot be instantiated directly.

Note
Inherit from this class to create custom deletion policies.
Template Parameters
TYPE[]Element type of the array.
DERIVEDCRTP Derived deleter type.

A specialization of deleterBase designed specifically for deleting arrays. Provides the interface for array-specific deletion policies.

Member Typedef Documentation

◆ rebound_deleter

template<typename TYPE , template< typename > class DERIVED>
template<typename T >
using original::deleterBase< TYPE, DERIVED >::rebound_deleter = DERIVED<T>

Rebound deleter type for type transformation scenarios.

Template Parameters
TNew type for the rebound deleter

Constructor & Destructor Documentation

◆ deleterBase()

template<typename TYPE , template< typename > class DERIVED>
constexpr original::deleterBase< TYPE, DERIVED >::deleterBase ( )
constexprdefaultnoexcept

Default constructor.

The constexpr specifier allows compile-time constant initialization.

◆ ~deleterBase()

template<typename TYPE , template< typename > class DERIVED>
original::deleterBase< TYPE, DERIVED >::~deleterBase ( )
pure virtualdefault

Pure virtual destructor.

Must be implemented by derived classes to ensure proper cleanup.

Member Function Documentation

◆ operator()()

template<typename TYPE , template< typename > class DERIVED>
virtual void original::deleterBase< TYPE, DERIVED >::operator() ( const TYPE ptr) const
pure virtualnoexcept

Deletion operator.

Parameters
ptrPointer to the object to delete.

This method must be implemented by derived classes to free the resource pointed to by ptr.

Note
The operation is noexcept to ensure exception safety in resource management.

Implemented in original::deleter< TYPE >, and original::deleter< TYPE[]>.


The documentation for this class was generated from the following file: