I have a code like:
char* text = ....
Historically, this functionality was provided by the now deprecated
istrstreamimplements input operations on array-backed streams. It essentially wraps a raw array I/O device implementation (
std::strstreambuf) into the higher-level interface of
The typical implementation of
istrstreamholds only one non-derived data member: an object of type
istrstreamhas been deprecated since C++98,
boost::iostreams::array_sourceare the recommended replacements.
Thus, a current implementation meeting your requirements is
The class templates
basic_arrayprovide access to a sequence of characters in memory. The array Devices do not manage the lifetimes of the underlying character sequences.
The array Devices are implemented as Direct Devices in order to provide efficient unbuffered access to the underlying character sequences.