lmi
[Top][All Lists]
Advanced

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

Re: [lmi] [lmi-commits] master 86aacf1 5/5: Clear error flags when reset


From: Vadim Zeitlin
Subject: Re: [lmi] [lmi-commits] master 86aacf1 5/5: Clear error flags when resetting stringstream contents
Date: Fri, 3 Mar 2017 15:24:38 +0100

On Tue, 28 Feb 2017 19:40:47 -0500 (EST) Greg Chicares <address@hidden> wrote:

GC> branch: master
GC> commit 86aacf1068183d1553f5fb9a2b2baabcd5cc1ae4
GC> Author: Gregory W. Chicares <address@hidden>
GC> Commit: Gregory W. Chicares <address@hidden>
GC> 
GC>     Clear error flags when resetting stringstream contents
GC> ---
GC>  progress_meter_wx.cpp | 1 +
GC>  rtti_lmi_test.cpp     | 1 +
GC>  2 files changed, 2 insertions(+)
GC> 
GC> diff --git a/progress_meter_wx.cpp b/progress_meter_wx.cpp
GC> index ab3cef4..98c3960 100644
GC> --- a/progress_meter_wx.cpp
GC> +++ b/progress_meter_wx.cpp
GC> @@ -120,6 +120,7 @@ void concrete_progress_meter::do_dawdle(int seconds)
GC>      for(int i = 10 * seconds; 0 < i && !progress_dialog_.WasCancelled(); 
--i)
GC>          {
GC>          wxMilliSleep(100);
GC> +        oss.clear();
GC>          oss.str("");
GC>          oss << "Waiting " << 0.1 * i << " seconds";
GC>          progress_dialog_.Update(count(), oss.str());

 Out of curiosity, how is it possible for this stream to get into the error
state? AFAICS we don't do anything with it that could set either "fail" or
"bad", do we?

GC> diff --git a/rtti_lmi_test.cpp b/rtti_lmi_test.cpp
GC> index 65eb3c6..4d1d75e 100644
GC> --- a/rtti_lmi_test.cpp
GC> +++ b/rtti_lmi_test.cpp
GC> @@ -66,6 +66,7 @@ void RttiLmiTest::TestTypeInfo()
GC>      // Usable with UDTs.
GC>  
GC>      ti1 = typeid(X);
GC> +    oss.clear();
GC>      oss.str("");
GC>      oss << ti1;
GC>      BOOST_TEST_EQUAL(oss.str(), lmi::detail::Demangle(typeid(X).name()));

 And here it looks like we only use "oss" to output a string to it, so
normally it shouldn't have any state bits set...

 What am I missing?
VZ


reply via email to

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