I want a boolean assigned to a method so then depending on the ouput of that method i know whether to execute a following method or not, but it does not seem to like the way i am doing it.
Code is below
bool ok = (boost::regex_match(str1,string_matcher))
{
DCS_LOG_DEBUG("Correct Number of Passengers");
output.push_back("Correct Number of Passengers\n");
DCS_LOG_DEBUG("2nd loop done 1");
}
else
{
a = st[0];
boost::regex const string_matcher1(splitMask[1]);
boost::trim(a);
if(boost::regex_match(a,string_matcher1))
{
DCS_LOG_DEBUG("Correct format for surnamce");
output.push_back("Correct format for surnamce\n");
DCS_LOG_DEBUG("2nd loop done 4");
}
else
{
DCS_LOG_DEBUG("Invalid format for surname");
output.push_back("Invalid format for surname\n");
DCS_LOG_DEBUG("2nd loop done 5");
}
}
What am i doing wrong there or is it not possible? would be happy for any help 🙂
You are missing an if:
{ …
OR: