lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master fc557ac 4/5: Simplify logic


From: Greg Chicares
Subject: [lmi-commits] [lmi] master fc557ac 4/5: Simplify logic
Date: Fri, 31 Jan 2020 11:29:39 -0500 (EST)

branch: master
commit fc557ac25422be3a56354c3a3359eee7e45511d4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Simplify logic
    
    This commit should remove the cause of the "other failure" here:
      https://lists.nongnu.org/archive/html/lmi/2020-01/msg00011.html
---
 stream_cast.hpp | 27 +++++++++++----------------
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/stream_cast.hpp b/stream_cast.hpp
index 8d778d6..a1d1b47 100644
--- a/stream_cast.hpp
+++ b/stream_cast.hpp
@@ -129,24 +129,19 @@ To stream_cast(From from, To = To())
         }
     else
         {
-        ; // Nothing left to do.
+        return result;
         }
 
-    if(!interpreter || !interpreter.eof())
-        {
-        err
-            << "converting '"
-            << from
-            << "' from type '"
-            << lmi::TypeInfo(typeid(From))
-            << "' to type '"
-            << lmi::TypeInfo(typeid(To))
-            << "'."
-            ;
-        throw std::runtime_error(err.str());
-        }
-
-    return result;
+    err
+        << "converting '"
+        << from
+        << "' from type '"
+        << lmi::TypeInfo(typeid(From))
+        << "' to type '"
+        << lmi::TypeInfo(typeid(To))
+        << "'."
+        ;
+    throw std::runtime_error(err.str());
 }
 
 template<>



reply via email to

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