编译错误“expected unqualified-id”使用模板时
对于我的代码,
template Signal<float>;
template Signal<bit_t>;
template Signal<byte_t>;
template Signal< std::complex<float> >;
template Signal< int >;
我收到编译错误
error at signal_T.cpp:437: error: expected unqualified-id before â;â token signal_T.cpp:438: error: expected unqualified-id before â;â token signal_T.cpp:439: error: expected unqualified-id before â;â token signal_T.cpp:440: error: expected unqualified-id before â;â token signal_T.cpp:441: error: expected unqualified-id before â;â token
编译器想告诉我什么?
我该如何修复这些错误?
For my code
template Signal<float>;
template Signal<bit_t>;
template Signal<byte_t>;
template Signal< std::complex<float> >;
template Signal< int >;
I get compilation errors
error at signal_T.cpp:437: error: expected unqualified-id before â;â token signal_T.cpp:438: error: expected unqualified-id before â;â token signal_T.cpp:439: error: expected unqualified-id before â;â token signal_T.cpp:440: error: expected unqualified-id before â;â token signal_T.cpp:441: error: expected unqualified-id before â;â token
What does the compiler want to tell me?
How can I fix these errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您编写诸如以下内容的意图是什么:
您是否尝试进行显式模板实例化?如果是这样,假设 Signal 是一个类模板,您需要将其更改为:
如果您尝试做其他事情,请提出问题。
What is your intent in writing lines such as:
Are you trying to do explicit template instantiation? If so, assuming Signal is a class template, you need to change that to:
If you're trying to do something else, please ask a question.