This is my code:
HelloApplication::HelloApplication(const Wt::WEnvironment& env)
: Wt::WApplication(env)
{
setTitle("Data Interpolation");
Wt::WText *InitialExplanation = root()->addWidget(std::make_unique<Wt::WText>());
InitialExplanation->setText("Welcome! This is a page that will allow you to interpolate the value at a point in the domain of your dataset, using other points in your dataset.\n I used Lagrange Interpolation for this calculation.\n Created By Vashist Hegde");
root()->addWidget(std::make_unique<Wt::WBreak>());
std::vector<double> xi;
std::vector<double> yi;
std::vector<double> xMissing;
double xM;
auto addDataPoint = [this,xi,yi,lineEdit1,lineEdit2] () mutable{
/// neither of the following push_backs is working.
/// I get 2 empty vectors in the end.
xi.push_back(std::move(std::stod(lineEdit1->text())));
yi.push_back(std::move(std::stod(lineEdit2->text())));
xi.push_back(3.5);
yi.push_back(4.5);
};
I don't get any errors but when I run the program, the vectors are just not getting populated. I get 0 sized vectors. Is this related to my general C++ usage or is it related to Wt (C++ Web toolkit)? If it is related to the general C++ usage, please help me as to what I'm doing wrong.