Boost Websocket - 非法使用类型"void"
Boost Websocket - illegal use of type 'void'
我正试图在我的应用程序中包含并编译一个boost 1.77.0 websocket。
// File.h
#include <boost/beast/core.hpp>
#include <boost/beast/websocket.hpp>
Boost是使用vcpkg(:x64 windows(安装的。当尝试编译时,我得到以下错误:
Error C2182 'executor_': illegal use of type 'void' - E:Githubvcpkginstalledx64-windowsincludeboostasioimplcompose.hpp Line 64
有人遇到过这个问题吗?找不到此问题上的任何内容。
我使用的是Visual Studio 16.11.5(C++17(。
注意:该项目包含.cu
文件。这可能是问题所在吗?在单独的解决方案中编译头不会产生任何错误。
compose.hpp
:的相关部分
template <typename Executor, typename = void>
class composed_work_guard
{
public:
typedef typename decay<
typename prefer_result<Executor,
execution::outstanding_work_t::tracked_t
>::type
>::type executor_type;
composed_work_guard(const Executor& ex)
: executor_(boost::asio::prefer(ex, execution::outstanding_work.tracked))
{
}
void reset()
{
}
executor_type get_executor() const BOOST_ASIO_NOEXCEPT
{
return executor_;
}
private:
executor_type executor_; // line 64
};
经过更多的研究,我设法解决了这个问题。我把boost代码放在另一个翻译单元中,这个单元不会被cuda编译器触及。
相关文章:
- 引用一个已擦除类型(void*)的指针
- 错误:"cast"未命名类型void setCastDescription(std::string
- 错误:对类型 'const ItemInstance' 的引用无法绑定到类型 'void' 的右值
- 从类型"void*"到函数指针的强制转换无效
- C++错误(从不兼容的类型"void"分配给树节点*)
- 从不兼容的类型 'void (Button::*)(int)' 分配给'void (*)(int)'
- 从类型"void*"到类member_function指针的强制转换无效
- 将 false 转换为指针类型 void*
- 称为对象类型"void (B::*)(int)"不是函数或函数指针
- CPP(15): 错误 C2182:"输入":"非法使用类型"void"
- 类型 "void (Biometria::*)(char *idSensor, GRCAP_FINGER_EVENTS event)" 的参数与类型 "GRCAP_STATUS_EVENT_PROC
- Xcode 变量具有不完整的类型 void
- qvector.h(74):错误 C2182:'t':非法使用类型 'void'
- C 函数声明对类型"void(*fcn)(void*)"参数的说明
- C++从类型“void*”转换为类型“double”无效
- LAMBDA 错误:类型 'void' 的条件表达式是非法的
- 类型 void 的值不允许在 C++ 中出错
- 从类型 'MyStruct' 转换为类型 'void*' 无效
- C++,参数类型(void*&)的目的是什么?
- 无法将不完整类型'void *'的参数转换为'const bitData'