title: Assign string to zmq::message_t without copying
body: <p>I need to do some high performance c++ stuff and that is why I need to avoid copying data whenever possible.</p>
  
  <p>Therefore I want to directly assign a string buffer to a zmq::message_t object without copying it. But there seems to be some deallocation of the string which avoids successful sending.</p>
  
  <p>Here is the piece of code:</p>
  
  <pre><code>for (pair&lt;int, string&gt; msg : l) {
      comm_out.send_int(msg.first);
      comm_out.send_int(t_id);
  
      int size = msg.second.size();
      zmq::message_t m((void *) std::move(msg.second).data(), size, NULL, NULL);
      comm_out.send_frame_msg(m, false); // some zmq-wrapper class
  }
  </code></pre>
  
  <p>How can I avoid that the string is deallocated before the message is send out? And when is the string deallocated exactly?</p>
  
  <p>Regards</p>