struct在普通的G++,中的工作中工作
我在QT中做了一个计算器GUI,并单独做出了一个可以使C ++中的计算的函数,但是在尝试将两者与.h
文件结合起来后,我得到了错误:>
每当我使用struct最小可重复可重复的示例时,都没有用于计算:: token
的匹配构造函数
:
#include <string>
namespace calculation
{
struct token
{
std::string type;
double value = -1;
std::string value_string;
};
void test(){
// Works fine in g++, error in Qt
token test{"test",0,"test"};
return;
}
}
int main(){
calculation::test();
return 0;
}
再次在标准G ++中起作用,但在QT中产生相同的错误
I made a calculator GUI in Qt and separately I made a function that can tokenize and evaluate calculations in c++, but upon attempting to combine the both with a .h
file, i got the error: no matching constructor for intialization of calculation::token
whenever I used a struct
Minimal reproducible example:
#include <string>
namespace calculation
{
struct token
{
std::string type;
double value = -1;
std::string value_string;
};
void test(){
// Works fine in g++, error in Qt
token test{"test",0,"test"};
return;
}
}
int main(){
calculation::test();
return 0;
}
Once again, this works in standard g++, but produces the same error in qt
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论