The Simple Functional Template Library
[[make]]
 

make

Definition

template<class T>
T make( T& value );
 
template<class U,class T>
T make( U& value );

Parameters

Parameter Description
value the object or value to be copied

Return value

An object or value of type T

Description

Returns an object or value of type T from the given value using the copy constructor

Examples

vector<int> numbers;
...
// makes a vector of int from numbers (same type)
vector<int> v1 = map( numbers, make<int> );
 
// makes a vector of double from numbers (different type)
vector<double> v1 = map( numbers, make<int,double> );
 
make.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