A
Alex Vinokur
I would like to define template function to display any container.
Something like (but syntax below is illegal because of S<T>):
template<typename S, typename T>
void display (std:stream& o_stream, const S<T>& i_data, const
std::string& i_delim = " ")
{
o_stream << std::flush;
std::copy (i_data.begin(), i_data.end(),
std:stream_iterator<T> (o_stream, i_delim));
o_stream << std::endl << std::flush;
}
Is there any solution?
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
Something like (but syntax below is illegal because of S<T>):
template<typename S, typename T>
void display (std:stream& o_stream, const S<T>& i_data, const
std::string& i_delim = " ")
{
o_stream << std::flush;
std::copy (i_data.begin(), i_data.end(),
std:stream_iterator<T> (o_stream, i_delim));
o_stream << std::endl << std::flush;
}
Is there any solution?
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn