lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 197119c: Add a cast to fix compilation in 64


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 197119c: Add a cast to fix compilation in 64 bits
Date: Sun, 12 Mar 2017 22:55:44 -0400 (EDT)

branch: master
commit 197119c9ea9ccf5d1d73e917e3661f2f4165931d
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Add a cast to fix compilation in 64 bits
    
    Under 64 bit Unix systems the difference between two iterators, which
    has std::ptrdiff_t type, is not of type "int" and hence we need an
    explicit cast to make the call to std::min<>() unambiguous.
---
 ledger.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ledger.cpp b/ledger.cpp
index ba6f8d3..1db9e62 100644
--- a/ledger.cpp
+++ b/ledger.cpp
@@ -172,7 +172,7 @@ void Ledger::ZeroInforceAfterLapse()
         }
     std::vector<double>::iterator b = ledger_invariant_->InforceLives.begin();
     std::vector<double>::iterator e = ledger_invariant_->InforceLives.end();
-    b += std::min(e - b, 1 + lapse_year);
+    b += std::min(static_cast<int>(e - b), 1 + lapse_year);
     if(b < e)
         {
         std::fill(b, e, 0.0);



reply via email to

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