The Simple Functional Template Library
 

deref_pointer

Definition

template<class T>
T deref_pointer( T* obj );

Parameters

Parameter Description
obj the object or value to be dereferenced

Return value

The dereferenced value

Description

Returns a copy of the dereferenced pointer to the value

Examples

vector<int*> numbers;
numbers.push_back( new int(1) );
numbers.push_back( new int(2) );
...
// convert numbers to a vector of int
vector<int> v1 = map( numbers, deref_pointer<int> );
 
deref_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