Created
November 2, 2015 10:23
-
-
Save r-lyeh-archived/4fc7ee5a0e06e9648284 to your computer and use it in GitHub Desktop.
memory stream
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct membuf: std::streambuf { | |
membuf(char* base, std::ptrdiff_t n) { | |
this->setg(base, base, base + n); | |
} | |
}; | |
membuf sbuf(base, n); | |
std::istream in(&sbuf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment