<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">There are some general cases when implicit conversion is standard and does not require any comment.  For example, it is the case with "const std::string&" parameter and all safe value preserving integer upconversions (from uint8 to uint32, etc.).<div><br></div><div>---</div><div>Alex</div><div><br></div><div><div><div>On Feb 15, 2014, at 8:17 PM, Junxiao Shi <<a href="mailto:shijunxiao@email.arizona.edu">shijunxiao@email.arizona.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Dear folks<div><br></div><div>Implicit conversion between integer and floating point numbers can cause problems and should be avoided.</div><div><br></div><div>Implicit conversion in single-argument constructor is usually undesirable. Therefore, all single-argument constructors should be marked 'explicit', unless implicit conversion IS desirable. In the few cases that implicit conversion is desirable, a comment should be placed near the constructor documenting the reason.</div>

<div><br></div><div>Yours, Junxiao<div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 15, 2014 at 8:52 PM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>This rule is very strange and I don't like following it.  Implicit conversions generally a good thing.  For the cases implicit conversion is undesirable, constructors should be mark explicit.</div>

<div><br></div><div>I don't see problems with any of the listed examples, except with enum (some compiler may issue warnings).</div><div><br></div><div>I prefer not considering this rule for us.</div><div><br></div><div>

---</div><div>Alex</div><div><div class="h5"><br></div></div></div></blockquote></div></div></div></div>
</blockquote></div><br></div></body></html>