[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] [PATCH] Add a cast to fix compilation in 64 bits
From: |
Vadim Zeitlin |
Subject: |
Re: [lmi] [PATCH] Add a cast to fix compilation in 64 bits |
Date: |
Tue, 14 Mar 2017 00:27:23 +0100 |
On Mon, 13 Mar 2017 23:12:07 +0000 Greg Chicares <address@hidden> wrote:
GC> Reexamining what I committed:
GC>
GC> using T = decltype(ledger_invariant_->InforceLives)::size_type;
GC> T original_length = ledger_invariant_->InforceLives.size();
GC>
GC> in that light, I see an obstacle to understanding that I'll emphasize by
GC> blanking out what is not visual similar between the two lines:
GC>
GC> T ledger_invariant_->InforceLives size ;
GC> T ledger_invariant_->InforceLives size ;
GC>
GC> After moving my eyes repeatedly between the (unexpurgated) two lines to
GC> make sure that the long common part in the middle is identical, I develop
GC> a bias that the rest is identical, which is confirmed when I see "size"
GC> twice; but "size" and "size_type" are not the same.
GC>
GC> I think this is an improvement:
GC>
GC> - using T = decltype(ledger_invariant_->InforceLives)::size_type;
GC> - T original_length = ledger_invariant_->InforceLives.size();
GC> + auto original_length = ledger_invariant_->InforceLives.size();
GC> + using T = decltype(original_length);
Yes, I agree, this is definitely an improvement. The only problem is that
we can't use "const" for "original_length" here, as then T would be "const"
as well. But I guess we'll just have to live with this.
Thanks,
VZ