On 03/01/14 19:55, Cosmin Truta wrote:
> On Fri, Jan 3, 2014 at 1:11 PM, Alexey Proskuryakov <a...@webkit.org
> <mailto:a...@webkit.org>> wrote:
>> One shouldn't need even basic familiarity with style system to see
> whether code leaks, introduces refcount thrashing, or copies too much.
> Using auto tends to make such mistakes much more opaque.
> 
> How about preserving not only the ptrs and refs, but also the
> CV-qualifiers, when applicable?
> 
> Example 1:
> auto* cache = new Cache; // right
> auto cache = new Cache; // wrong, should be auto*
> Cache* cache = new Cache; // wrong, should be auto*
> 
> Example 2:
> const ClipboardFormatMap& formatMap = getClipboardMap(); // right
> const auto& formatMap = getClipboardMap(); // also right
> auto& formatMap = getClipboardMap(); // wrong, missing const
> auto formatMap = getClipboardMap(); // wrong, missing const and &

IMHO by using auto preserving the qualifiers we gain nothing and lose
the type information.

BR
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to