lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] [low priority] How to deal with variable shadowing warnings?


From: Greg Chicares
Subject: Re: [lmi] [low priority] How to deal with variable shadowing warnings?
Date: Sun, 27 Mar 2016 13:06:42 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0

On 2016-02-10 04:26, Vadim Zeitlin wrote:
> On Mon, 8 Feb 2016 03:25:06 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> On 02/08/2016 12:54 AM, Vadim Zeitlin wrote:
> GC> > 
> GC> >  The latest version of MSVC compiler (MSVS 2015 a.k.a. VC 14) enables 
> the
> GC> > warnings about variables hiding other names in the same scope by default

https://github.com/vadz/lmi/commit/ebbf323183e5dda08a86b7f6b38107bb1d3fd744.patch

-    ledger_map_t::const_iterator i = l_map_rep.begin();
-    for(;i != l_map_rep.end(); i++)
+    using lmci = ledger_map_t::const_iterator;
+    for(lmci i = l_map_rep.begin();i != l_map_rep.end(); i++)

The order of typdef declarations never made much sense to me:
  typedef int new_type;
reads like
  let 2 = a; // backwards!
I'm glad to see that C++11 finally got this right.

Of course we should prefer this new syntax in brand-new modules. And I'd be
happy to replace all old typedefs with 'using' because it's more readable.
But I rewrote this one with 'typedef' because I don't want to introduce
random inconsistency.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]