void post(cobst std::string & data) { lock; queue.emplace_back(data); } void process() { std::string * data = nullptr; { lock; if (queue.empty()) { return; } data = &(queue.front); } char buffer[1024]; strcpy(data.data(), data.size()); }