Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Is there a non-allocating String similar to a string_view in NTL?
Re: Is there a non-allocating String similar to a string_view in NTL? [message #58466 is a reply to message #58465] Sat, 28 May 2022 09:48 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 221
Registered: June 2011
Experienced Member
Oblivion wrote on Sat, 28 May 2022 09:32
Do you really need intermeadiary level?

    const char *test = "this is a test \n";
    MemReadStream ms(test, strlen(test));
    Cout().Put(ms); //cheap... 


(De)serialization, which eventually involves copying if you're going to put the data into new String, can be done via Stream helpers.(Eg LoadStream, SaveStream et al.)

Best regards,
Oblivion


Cool that works. ms.Put(Cout()) did not work.

Quote:

Do you really need intermeadiary level?


If it was just for display I'd be fine with copying, but suppose you wanted to perform a text search within the fields of a million mmaped records. It's a lot of unnecessary copying.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Relocated Upp Folder - Missing Packages
Next Topic: No mouse hover tip?
Goto Forum:
  


Current Time: Sun May 12 00:06:09 CEST 2024

Total time taken to generate the page: 0.01396 seconds