ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] streams - basic_nullbuf
by Jeff Garland other posts by this author
Sep 25 2003 12:24PM messages near this date
Re: [boost] streams - basic_nullbuf | [boost] basic_debugstream (was: streams - basic_nullbuf)
On Thu, 25 Sep 2003 Lars Gullik Bjønnes wrote

>  Jeff Garland wrote:
>  > My approach was a bit different in that I didn't bother with the buffer at
>  > all, but created the ostream interface directly in hope that the

> But if you are going to compile anyway, then you could use other
> methods as well (pre-processor).

Yes, but macros are evil and impact code readability.  I just really hate lots
of code like:
  
  TRACE("I'm here" << foo << std::endl);

The all caps thing is really bothersome to me.  And of course there is the
loss of ability to set have a tracing version and a non-tracing version in one
 compilation unit.

>  How will this behave for user defined types?

Same because of omitted detail below...

>  Do I have to add a operator<< for both ostream and null_ostream?

No...

template<class T> 
null_ostream&
operator<<(null_ostream& os, const T&)
{
  return os;
}

I'm not saying my idea was fully baked -- there may be some fatal flaw I
haven't worked out.  Just wanted to point out other potential approaches and
requirements while expressing support for getting something like this in boost.

Jeff


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
John Torjo
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
Gennadiy Rozental
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
Jeff Garland
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
Jeff Garland
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
Jeff Garland
Jeff Garland
Samuel Krempp
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
=?iso-8859-1?q?Lars_Gullik_Bj=F8nnes?=
val salamakha
Ulrich Eckhardt
val salamakha

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved