home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 32,067 of 33,346   
   Pete Becker to Nikolay Ivchenkov   
   Re: Modification of trailing null charac   
   29 Mar 12 20:51:01   
   
   4fb27f0e   
   From: pete@versatilecoding.com   
      
   On 2012-03-29 21:05:40 +0000, Nikolay Ivchenkov said:   
      
   > On 29 Mar, 23:13, Seungbeom Kim  wrote:   
   >> Therefore, I think an implementation   
   >> that doesn't keep a null character at the end is making things difficult   
   >> for itself for no good reason I can see.   
   >   
   > Such implementations of basic_string are disallowed under C++11 rules   
   > - see 21.4.7.1/1.   
      
   Not really. c_str() can return a pointer to a newly-allocated array   
   that holds a copy of the data, with a terminating 0. Sigh.   
      
   But I vaguely recall that there was a change for C++11 that did   
   disallow this kind of thing, but it's not coming to mind at the moment.   
      
   --   
      Pete   
   Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The   
   Standard C++ Library Extensions: a Tutorial and Reference   
   (www.petebecker.com/tr1book)   
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca