title: How to "cast" a std::vector<char> to std::vector<wchar_t>
body: <p>I have a std::vector of bytes (<code>char</code>), I'd like to do the equivalent of just <em>"C-style casting"</em> this vector to a vector which is of type <code>wchar_t</code>.</p>
  
  <p>Obviously, what I really have to do is to copy the data, but the thing here is that I already have an UTF-16 byte stream on the left side, I just wanna move that over to the <code>wchar_t</code> vector so that I can use it. Ideally, I'd like to just swap the buffer, but I'm not sure how to do that in safe manner...</p>
  
  <p>What's the C++ way of doing an as efficient as safe conversion copy operation allows?</p>
  
  <h1>NOTE:</h1>
  
  <p>I do store my UTF-16 strings as <code>std::wstring</code> or <code>std::vector&lt;wchar_t&gt;</code> but I have this memory buffer that I happen to know is UTF-16, and I need to copy it, somehow...</p>