我想将“boost :: array”传递给“booth :: thread”作业。C++ //将Boost :: array传递给Boost ::线程
typedef unsigned char BYTE;
boost::array<BYTE,256> readBuffer;
thread gojob(&thread_job, readBuffer.data());
如何通过它?
void serial::thread_job(BYTE *received) {
}
我写了这..但编译给我奇怪的消息仅.. 我不明白他在说....
include/boost/bind/mem_fn.hpp:333:36: error: cannot apply member pointer ‘((const boost::_mfi::dm<void(unsigned char*), serial>*)this)->boost::_mfi::dm<void(unsigned char*), serial>::f_’ to ‘* boost::get_pointer<unsigned char>(((unsigned char*)u))’, which is of non-class type ‘unsigned char’
[貌似'的boost ::数组::数据()''是const',一件事(http://www.boost.org/ DOC /库/ 1_60_0/DOC/HTML /升压/ array.html#idm45507153295488-BB)。所以你试着将'unsigned char const *'传递给一个期待'unsigned char *'的函数。通过一个复杂的图书馆,它可以给我们一些奇怪的错误,我猜。 – BoBTFish