On 18 February 2014 09:01, Walter Bright <[email protected]> wrote:

> On 2/17/2014 2:43 PM, Ary Borenszweig wrote:
>
>> Now suppose bit_flag can get an additional "new_bit_flag" value. How does
>> "default" helps me notice that I'm supposed to add it to that switch
>> statement?
>>
>
> Because if you account for all the cases, you write:
>
>    default: assert(0);
>
> Now you intentionally tell the user that you intentionally covered all the
> cases.


I think 'final switch' should do that for you, and by typing final, you've
intentionally covered the case. There's no room for mistake then.

Reply via email to