所以我使用Flash C++ 编译器(又名 flascc,alchemy)和 havin 代码,例如:
boost::function<var (void*, var)> f = boost::bind(&as3_socket::socket_socketData, this, _1, _2);
socket->addEventListener(flash::events::ProgressEvent::SOCKET_DATA, Function::_new(f, NULL));
得到下一个编译器错误:
$ g++ $JN -static -emit-llvm -c src/utils/http/as3_socket.cpp -I../boost/boost_libraries/install-dir/include
src/utils/http/as3_socket.cpp: In constructor ‘as3_socket::as3_socket()’:
src/utils/http/as3_socket.cpp:75: error: no matching function for call to ‘AS3::ui::Function::_new(boost::function<AS3::ui::var ()(void*, AS3::ui::var)>*, NULL)’
/cygdrive/c/Users/Avesta/Downloads/FlasCC_1.0.1134176_11-09-2012/sdk/usr/bin/../../usr/include/AS3++/builtin.h:179: note: candidates are: static AS3::ui::Function AS3::ui::Function::_new()
/cygdrive/c/Users/Avesta/Downloads/FlasCC_1.0.1134176_11-09-2012/sdk/usr/bin/../../usr/include/AS3++/builtin.h:180: note: static AS3::ui::Function AS3::ui::Function::_new(AS3::ui::var (*)(void*, AS3::ui::var), void*)
所以问题是如何从boost::function<var (void*, var)>
更多的C风格中获得var (*)(void*, var)