即时铸造
char* something= reinterpret_cast<char*>(&GPBuffer);
而不是回到:
char temp1 [400];
string buffer = reinterpret_cast<string&>(temp1);
我知道将字符串转换为 char* 看起来很愚蠢,但这是我需要的并且它有效!
但是如果我将“某事”(抛出内部队列)传递给另一个线程,并且我尝试回退,我会收到:
0x00000000009bb2dd in std::basic_string, std::allocator >::operator= (this=0x48410790, __str=Traceback (最近一次调用最后): 文件 "/usr/share/gdb/python/libstdcxx/v6/printers.py" ,第 469 行,在 to_string 返回 self.val['_M_dataplus']['_M_p'].string (encoding, length = len) OverflowError: signed integer is less than minimum ) at /usr/lib/gcc/x86_64-redhat- linux/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:486
有人熟悉这个错误吗?