[Nfd-dev] code style rule 44

Junxiao Shi shijunxiao at email.arizona.edu
Sat Feb 15 20:17:39 PST 2014


Dear folks

Implicit conversion between integer and floating point numbers can cause
problems and should be avoided.

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.

Yours, Junxiao

On Sat, Feb 15, 2014 at 8:52 PM, Alex Afanasyev <
alexander.afanasyev at ucla.edu> wrote:

> 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.
>
> I don't see problems with any of the listed examples, except with enum
> (some compiler may issue warnings).
>
> I prefer not considering this rule for us.
>
> ---
> Alex
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20140215/a50c8079/attachment.html>


More information about the Nfd-dev mailing list