D
dimanwv
такой вопрос.
template <typename T>
void show(const char *msg,vector<T> vect)
{
cout<<msg;
for(unsigned i=0;i<vect.size();++i)
cout<<vect<<" ";
cout<<"\n";
}
vector<int> copied(5);
show<int>("Vector have been sorted :",copied);// здесь в угловых скобках указываем тип.
///////////////////////////////////////////////////////////
template<typename InIter>
void show_range(const char* msg,InIter start,InIter end)
{
InIter itr;
cout<<msg;
for(itr=start;itr!=end;++itr)
cout<<*itr<<" ";
cout<<endl;
}
vector<double> trans_v;
for(trans_i=0;trans_i<10;++trans_i)
trans_v.push_back(static_cast<double>(trans_i));
cout<<"The demonstration \"transform\" algorithm using one vector.\n";
show_range("The initial content of \"trans_v\" is :\n",trans_v.begin(),trans_v.end());//здесь в не применяем угловые скобки почему?
template <typename T>
void show(const char *msg,vector<T> vect)
{
cout<<msg;
for(unsigned i=0;i<vect.size();++i)
cout<<vect<<" ";
cout<<"\n";
}
vector<int> copied(5);
show<int>("Vector have been sorted :",copied);// здесь в угловых скобках указываем тип.
///////////////////////////////////////////////////////////
template<typename InIter>
void show_range(const char* msg,InIter start,InIter end)
{
InIter itr;
cout<<msg;
for(itr=start;itr!=end;++itr)
cout<<*itr<<" ";
cout<<endl;
}
vector<double> trans_v;
for(trans_i=0;trans_i<10;++trans_i)
trans_v.push_back(static_cast<double>(trans_i));
cout<<"The demonstration \"transform\" algorithm using one vector.\n";
show_range("The initial content of \"trans_v\" is :\n",trans_v.begin(),trans_v.end());//здесь в не применяем угловые скобки почему?