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,907 of 33,346   
   Dave Harris to Francis Glassborow   
   Re: insert [sorted] a node in a linked l   
   10 Mar 13 15:42:41   
   
   From: brangdonj@googlemail.com   
      
   In article ,   
   francis.glassborow@btinternet.com (Francis Glassborow) wrote:   
   > As a matter of interest, what container would you suggest be used   
   > for substantial amounts of text (e.g. a 500 page book)?   
      
   A vector of paragraphs, where each paragraph is a vector of   
   characters. (Or maybe a string; but I'm not a fan of std::string.)   
      
   A paragraph may sound like a large unit, but in practice it takes   
   almost no time to shuffle up a few thousand characters because of   
   memory locality.   
      
   There is an argument that you should not divide the text into   
   segments based on the text contents, because someone might write a   
   single paragraph that's 500 pages long. In practice I've not found   
   this to be a problem.   
      
   -- Dave Harris, Nottingham, UK.   
      
      
   --   
         [ 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