السلام عليكــم ورحمـة الله وبركاتــه
struct null_stream: std::ostream
{
struct nullbuf: std::streambuf
{
int overflow( int c )
{
return traits_type::not_eof( c );
}
}
m_sbuf;
null_stream():
std::ios( &m_sbuf ),
std::ostream( &m_sbuf )
{ }
};class null_stream: public std::ostream
{
public:
class nullbuf: public std::streambuf
{
public:
int overflow( int c )
{
return traits_type::not_eof( c );
}
m_sbuf;
null_stream():
std::ios( &m_sbuf ),
std::ostream
( &m_sbuf )
{ }
};مالفرق بينهما


