<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 18 February 2014 09:01, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 2/17/2014 2:43 PM, Ary Borenszweig wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Now suppose bit_flag can get an additional "new_bit_flag" value. How does<br>
"default" helps me notice that I'm supposed to add it to that switch statement?<br>
</blockquote>
<br></div>
Because if you account for all the cases, you write:<br>
<br>
   default: assert(0);<br>
<br>
Now you intentionally tell the user that you intentionally covered all the cases.</blockquote><div><br></div><div>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.</div>
</div></div></div>