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