inline Problem operator|(Problem a, Problem b)
{
return static_cast<Problem>(
static_cast<uint8_t>(a) |
static_cast<uint8_t>(b)
);
}
inline Problem operator&(Problem a, Problem b)
{
return static_cast<Problem>(
static_cast<uint8_t>(a) &
static_cast<uint8_t>(b)
);
}
inline Problem& operator|=(Problem& a, Problem b)
{
a = a | b;
return a;
}
Returning Combined Problems
Problem checkStuff()
{
Problem result = Problem::None;
if (!fileOk)
result |= Problem::FileError;
if (!parsed)
result |= Problem::ParseError;
return result;
}