<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 24, 2013 at 6:07 PM, Sean Silva <span dir="ltr"><<a href="mailto:chisophugis@gmail.com" target="_blank" class="cremed">chisophugis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think it makes a lot of sense in this case. The idea is that you increase indentation in the "error" case.</blockquote>
</div><br>I vehemently disagree.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Use the return value and type that make sense for the ABI and will be unsurprising when reading the code. Use a ! when you need to produce early-exit code flows.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">A note about error objects: you should always have a variable and/or type name here. This gives you the opportunity to make it perfectly unambiguous whether it was an error or success. The example I give is std::error_code:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">if (std::error_code ec = some_filesystem_operation(...)) {</div><div class="gmail_extra">  /* unambiguously have an error code, because the condition was on the error code, not the function */</div>
<div class="gmail_extra">}</div><div class="gmail_extra"><br></div></div>