Skip to content

Text-based IO help? #134

Answered by ned14
ethindp asked this question in Q&A
Discussion options

You must be logged in to vote

Strings in C++ are currently just bytes, and std::span has some helper member functions to return a span of T as a span of bytes. So you could - if you wanted to - turn the string buffer into a span of char, take that into a span of bytes, read into that.

Or just do reinterpret cast as you currently do.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ethindp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants