Boost logo

Boost Users :

From: Ed Hill (ed_at_[hidden])
Date: 2008-01-16 13:53:07


On Wed, 16 Jan 2008 13:09:17 -0500 Lorenzo Cavallaro wrote:
>
> I'm trying to unserialize a boost::archive::text_iarchive. The
> code used to work, but know (for no apparent reasons) it's calling
> terminate throwing the following exception.
>
> terminate called after throwing an instance of
> 'boost::archive::archive_exception what(): stream error
> Aborted

Hi Lorenzo,

Under these circumstances:

  1) classes contain float or double members
  2a) [intentional] the floats/doubles are used to store
      NaN or +/-Inf values
  2a) [unintentional] the floats or doubles are un-initialized
     and the memory they use just happens to contain (by
     circumstance) bit patterns for NaN or +/-Inf

serialization to text or XML will "work" (that is, will run without
errors) but de-serialization will result in stream errors since:

   double a;
   cin >> a;

fails for "NaN", "Inf", etc.

Ed

-- 
Edward H. Hill III, PhD  |  ed_at_[hidden]  |  http://eh3.com/



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net