E
er
Hello,
Could someone please suggest a solution for this that works with
std:stream_iterator:
struct foo
{
foo(){}
private:
friend std:stream & operator<<(std:stream &os, const foo&
p);
};
std:stream& operator<<( std:stream& os, foo const& t)
{
// whatever
}
typedef std::vector<foo> vec_;
vec_ vec; vec.push_back( foo() );
std::copy(
vec.begin(),
vec.end(),
std:stream_iterator<foo>( std::cout, " ")
);
error : no match for call to std:stream_iterator<foo>( foo& );
Could someone please suggest a solution for this that works with
std:stream_iterator:
struct foo
{
foo(){}
private:
friend std:stream & operator<<(std:stream &os, const foo&
p);
};
std:stream& operator<<( std:stream& os, foo const& t)
{
// whatever
}
typedef std::vector<foo> vec_;
vec_ vec; vec.push_back( foo() );
std::copy(
vec.begin(),
vec.end(),
std:stream_iterator<foo>( std::cout, " ")
);
error : no match for call to std:stream_iterator<foo>( foo& );