RETURN_FAILURE("The copy query stores "<<copyQuery<<" while the other one has "<<initQuery);
}
copyQuery=std::nullopt;
if(copyQuery.isValid()){
RETURN_FAILURE("After setting back to nullopt it's supposed to be invalid.");
}
copyQuery=7;
if(!copyQuery.isValid()){
RETURN_FAILURE("Expect the query to be valid.");
}
if(copyQuery!=7){
RETURN_FAILURE("Expect the query to be 7 and not "<<copyQuery);
}
copyQuery=std::move(initQuery);
if(copyQuery!=5){
RETURN_FAILURE("Expect the query to be 5 and not "<<copyQuery);
}
/// Apparently, the move on an optional does not invalidate the optional (https://stackoverflow.com/questions/51805059/why-does-moving-stdoptional-not-reset-state)
///if (initQuery.isValid()) {
/// RETURN_FAILURE("Initial query needs to be invalid and not "<<initQuery);
///}
initQuery=copyQuery;
if(!initQuery.isValid()){
RETURN_FAILURE("Initial query needs to be valid again");