title: kdb c++ interface: create byte list from std::string
body: <p>The following is very slow for long strings:</p>
  
  <pre><code>std::string s = "long string";
  K klist = DBVec::CreateList(KG , s.length());
  for (int i=0; i&lt;s.length(); i++)
  {
      kG(klist)[i]=s.c_str()[i];
  }
  </code></pre>
  
  <p>It works acceptably fast (&lt;100ms) for strings up to 100k, but slows to a crawl (tens of minutes, possibly hours) for strings of a few million characters. I don't see anything other than <code>kG</code> that can create nonlinearity. I don't see any reason for accessor function <code>kG</code> to be non-constant time, but there is just nothing else in this loop. Unfortunately I don't know how <code>kG</code> works due to lack of documentation.</p>
  
  <p>Question: given a blob of binary data as std::string, what's the efficient way to construct a byte list?</p>