The Simple Functional Template Library
 

delete_pointer

Definition

template<class T>
void delete_pointer( T* obj );

Parameters

Parameter Description
obj the object or value to be delete

Return value

Nothing

Description

Deletes the given argument.

Examples

vector<int*> numbers;
numbers.push_back( new int(1) );
numbers.push_back( new int(2) );
...
// free allocated memory for elements in container
apply( numbers, delete_pointer<int> );
 
delete_pointer.txt · Last modified: 2007/08/24 23:31 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki