U++ framework
Do not panic. Ask here before giving up.

Home » Community » Newbie corner » How do I write string_view to Cout() without copying to a String?
How do I write string_view to Cout() without copying to a String? [message #60282] Wed, 08 November 2023 15:03
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 227
Registered: June 2011
Experienced Member
Right now I'm using:

Cout().Put(str.begin(), str.length());


But it would be nice if Stream had an overload to do this automatically so I can write

Cout() << str;


Without it complaining about the lack of ToString() which demands an unnecessary copy, the same way it works with std::cout.
Previous Topic: While loop, sleep
Next Topic: Help needed with OptionTree
Goto Forum:
  


Current Time: Wed May 20 22:44:27 GMT+2 2026

Total time taken to generate the page: 0.00511 seconds