This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: return-value policy question


On Tue, Apr 29, 2003 at 02:07:38PM -0400, Phil Edwards wrote:
> On Mon, Apr 28, 2003 at 10:30:12PM -0700, Nathan Myers wrote:
> > or the even simpler and more traditional
> > 
> >       return (_M_out_cur < _M_out_end) ?
> >         traits_type::to_int_type(*_M_out_cur++ = __c) :
> >         this->overflow(traits_type::to_int_type(__c));
> 
> Normally I'm not a style bigot, but Sweet Lord, that's hideously ugly.

"Traditional" is the polite way to express it.  (Although of course it's 
really the "traits_type::to_int_type" call that makes it ugly. :-)

I included it as an extremum, not a proposal.  However, if on some
platform it led to a 10% speed difference in streambuf performance, 
I would barely hesitate to code it that way.  (I.e. I probably 
would try variations to see if something clearer produced the same 
performance.)

Nathan Myers
ncm-nospam@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]