24-08-2023, 12:05 PM
Consider this piece of code:
Is the above compliant with M6-3-1, or does one need to add braces also to the "case" blocks, e.g.:
Thanks!
Code:
enum Foo
{
a,
b
};
void foo(Foo f)
{
switch(f)
{
case a:
std::cout << "a\n";
break;
case b:
std::cout << "b\n";
break;
}
}
Is the above compliant with M6-3-1, or does one need to add braces also to the "case" blocks, e.g.:
Code:
case a:
{
std::cout << "a\n";
break;
}
Thanks!