|
|
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  |
jjacksonRIAB
Messages: 227 Registered: June 2011
|
Experienced Member |
|
|
Oblivion wrote on Sat, 28 May 2022 09:32Do 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.
|
|
|
Goto Forum:
Current Time: Fri Apr 25 23:03:54 CEST 2025
Total time taken to generate the page: 0.00889 seconds
|
|
|