Re: [Stlport-devel] HP-UX aCC 6 support?
Brought to you by:
complement
From: <fra...@fr...> - 2006-04-18 20:14:48
|
>> "../../stlport/stl/_string.h", line 475: warning #2430-D: returning >> reference to local temporary >> { return __n == size() ? __STATIC_CAST(const _CharT&, >> _STLP_DEFAULT_CONSTRUCTED(_CharT)) : *(this->_M_Start() + __n); } >> > > > The standard says that the returnvalue must be a reference. Further, it allows > the index to be one off, i.e. 'size' and not just 'size-1', in which case it > should return CharT(), which unfortunately is a temporary. I'd consider it an > oversight in the standard, pre-release versions of the standard still > specified 'traits_type::eos' as returnvalue, which seemed to have similar > intentions. > > I think the current development version always terminates the internal string > with a NUL character and then returns a reference to this character. > > You are right Uli, development version always terminate string with a null character so code is simply: { return *(this->_M_Start() + __n); } Bests > Uli > > **************************************************** > Visit our website at <http://www.domino-printing.com/> > **************************************************** > This Email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this Email in error please notify the system manager. > > This footnote also confirms that this Email message has been swept by MailSweeper for the presence of computer viruses. > **************************************************** > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Stlport-devel mailing list > Stl...@li... > https://lists.sourceforge.net/lists/listinfo/stlport-devel > > > |