<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 9, 2017, at 10:20 AM, Reid Kleckner via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 9, 2017 at 7:25 AM, Piotr Padlewski via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><span class="">2017-01-09 16:15 GMT+01:00 Renato Golin <span dir="ltr" class=""><<a href="mailto:renato.golin@linaro.org" target="_blank" class="">renato.golin@linaro.org</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 9 January 2017 at 14:17, Piotr Padlewski via cfe-dev<br class="">
<span class=""><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank" class="">cfe-dev@lists.llvm.org</a>> wrote:<br class="">
> - prefer "using' instead of "typedef"<br class="">
> - use default member initialization<br class="">
</span><span class="">> - use default, override, delete<br class="">
> - skip "virtual" with override<br class="">
<br class="">
</span>I thought we had all of those already...<br class="">
<span class=""><br class=""></span></blockquote></span><div class="">Nope, some people use it, but I still see a lot of new code with typedefs.</div><div class="">I would like to have it written in style guide so it will be easier to convince to change in review.</div></div></div></div></blockquote><div class=""><br class=""></div><div class="">The last two are enforced by compiler warnings now. The second is hard because of bitfields.</div><div class=""><br class=""></div><div class="">I object to the first. If you need a new type name, use a typedef. It's time honored and everyone, including C programmers, will know what you're doing. I don't understand why people push the new thing just for the sake of new-ness. </div></div></div></div></div></blockquote></div><br class=""><div class="">`using` handles strictly more cases than `typedef`, in particular partial specialization of templates. So because we’ll end up with `using` anyway, uniformity can be valuable. So that could be a motivation: since `using` is needed anyway, might be better to just use it always (I’m not saying it is a “strong” motivation though, just some piece of rational). </div><div class="">(I also find that typedef of function pointers in particular are terrible, and `using` is much better for these, but that can be a matter of taste).</div><div class=""><br class=""></div><div class="">—</div><div class="">Mehdi</div></body></html>