Boost logo

Boost Users :

From: Gancho Manev (gmanev_at_[hidden])
Date: 2008-06-10 04:30:57


>> Hi,
>>
>> The following code does not throw archive_exception always:
>>
>> std::stringstream ss;
>> boost::archive::text_iarchive ia(ss);
>
> Note that the above code is not correct usage of the library and shuold
> through
> some some sort of error or exception.

I haven't found any line in the documentation that puts a precondition
on the stream. What are the preconditions though?

Even the stream content is valid there is always a possibility of
failure when read. The text_iarchive constructor does not check that
leaving a big chance of unexpected exception or even program crash.

Thanks,
Gancho Manev


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