gpt4 book ai didi

c++ - 如何从 `var (*)(void*, var)` 中获取 C 指针(如 `boost::function` )?

转载 作者:太空宇宙 更新时间:2023-11-04 12:02:03 27 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
demote boost::function to a plain function pointer

所以我使用Flash C++ Compiler (aka flascc, alchemy)并且有这样的代码:

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)

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com