#include <list>
#include <vector>
#include <iostream>
using namespace std;
template <class T>
void print(T& c){
for( typename T::iterator i = c.begin(); i != c.end(); i++ ){
std::cout << *i << endl;
}
}
int main( )
{
const double data[] = { 3.14, 2.78, 1.51, 7.66, 9.65 };
list<double> original( data, data + sizeof( data ) / sizeof( data[0] ) );
vector<double> vector_data( 3, 3.33 );
list<double> list_data( 4, 4.44 );
// show results
print( original );
print( vector_data );
print( list_data );
// assign a list to a list
list_data = original;
// assign a list to a vector
vector_data.assign( original.begin(), original.end() );
print( list_data );
print( vector_data );
}