I'm trying to get a std::wstreambuf
from a std::wstring
, so I managed to do it like the following :
struct membuf : std::wstreambuf
{
public:
membuf(std::wstring begin, std::wstring end) {
this->setg(&begin[0], &begin[0], &end[0]);
}
};
std:wstring wstr = L"Im a random test\n";
membuf sbuf(&wstr[0], &wstr[wstr.size()]);
The thing is that sbuf
is filled with "☐"
I can't understand why.
Does anyone have an idea ?