Unless I'm misunderstanding it should be as simple as:

wchar[100] stackws; // alloca() if you need it to be dynamically sized.

A slice of this static array behaves just like a slice of a dynamic array.

I do need it to be dynamically sized. I also want to avoid copying my string data if possible. Basically, I just want to create a wstring "view" on an existing "raw" buffer that exists in memory somewhere, based on a pointer to this buffer and its length.

Side note: wouldn't alloca just produce a wchar*, not an array (wouldn't have length information)?

Reply via email to