From: David Abrahams (dave_at_[hidden])
Date: 2005-06-28 06:56:21
"Peter Dimov" <pdimov_at_[hidden]> writes:
> David Abrahams wrote:
>> "Peter Dimov" <pdimov_at_[hidden]> writes:
>>> David Abrahams wrote:
>>>> "Peter Dimov" <pdimov_at_[hidden]> writes:
>>>>> If you are given an archive you don't know whether you are allowed
>>>>> to save by value, or whether you can safely save by pointer.
>>>>> (In general.)
>>>> Yeah, but what's the use case for this? Someone you don't know
>>>> hands you an archive and tells you to save something in it without
>>>> telling you how it's safe to do so?
>>> Yep, that's pretty much what happens every time your 'save' function
>>> is invoked.
>> Then it's almost impossible to write a reliable save function.
> It's impossible to write a reliable save function regardless of that.
This just seems cryptic. What do you mean?
>> How is the exception going to help?
> By detecting that this particular sequence of saves (which in general
> depends on the structure being saved and is a runtime property) would have
> produced an unreadable archive.
An assertion can detect that, too. My point is that you have to have
enough knowledge about how the program is structured, etc., to do the
save reliably or there's little point in trying.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk