<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 14, 2013 at 5:02 PM, bearophile <span dir="ltr"><<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Ali Çehreli:<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
> When is an enum *better* than a normal (static<br>
const/immutable) constant?<br>
<br>
Good question. :)<br>
</blockquote>
<br></div>
When you can or want to compute something at compile-time, when you need values to feed to templates, etc.<br>
<br></blockquote><div><br></div><div>but you can *can* do that with static const /const/immutable variables too:</div><div><br></div><div>auto fun2(int a)(int b){...}<br></div><div><div>immutable a=fun(2);//static const /const/immutable/enum</div>
<div>auto b=fun2!a(3);</div></div><div><br></div><div><br></div></div></div></div>