All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
blaze::DefaultDelete< Type > Struct Template Reference

Default C++ deletion policy class.The DefaultDelete deletion policy is the standard delete for resources allocated via the new operator. It uses delete or array delete (depending on the template argument) to free the resource: More...

#include <DefaultDelete.h>

Public Member Functions

Utility functions
void operator() (Type *ptr) const
 Implementation of the default delete policy. More...
 

Detailed Description

template<typename Type>
struct blaze::DefaultDelete< Type >

Default C++ deletion policy class.

The DefaultDelete deletion policy is the standard delete for resources allocated via the new operator. It uses delete or array delete (depending on the template argument) to free the resource:

class Resource { ... };
DefaultDelete<Resource> ptrDelete // Uses delete to free resources
DefaultDelete<Resource[]> arrayDelete; // Uses array delete to free resources

Note the explicit use of empty array bounds to configure DefaultDelete to use array delete instead of delete. Also note that the delete operation is NOT permitted for incomplete types (i.e. declared but undefined data types). The attempt to apply a DefaultDelete functor to a pointer or array to an object of incomplete type results in a compile time error!

Member Function Documentation

template<typename Type >
void blaze::DefaultDelete< Type >::operator() ( Type *  ptr) const
inline

Implementation of the default delete policy.

Parameters
ptrThe pointer to delete.
Returns
void

This function frees the given pointer resource via delete. Note that the delete operation is NOT permitted for incomplete types (i.e. declared but undefined data types). The attempt to use this function for a pointer to an object of incomplete type results in a compile time error!


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