//Title of this code

#include <iostream>
#include <algorithm>
#include <list>

template< typename T, typename F >
std::list< T > make_range( size_t limit, F func )
{
    std::list< T > result( limit );
    for( auto itr = result.begin(); itr != result.end(); ++itr )
        *itr = func();    
  
    return result;
}

int main()
{
    auto ls = make_range< int >( 10, []{ return 1; } );
    
    for( auto i : ls )
        std::cout << i << " ";
    
}