From: Kevlin Henney (kevlin_at_[hidden])
Date: 2001-07-20 11:59:42
> From: "Peter Dimov" <pdimov_at_[hidden]>
>From: "Corwin Joy" <cjoy_at_[hidden]>
>> Given that the original 'any' class provided const only access, I think it
>> would be interesting to hear what the compelling argument was for adding
>> non-const access to the 'any' class in the first place.
Yes, but that was way back when :-)
>Anyway, I have one question to Kevlin:
>Why is a copy-on-write 'any' implementation non-conforming? What (single
>threaded) valid user program does not work with a COW implementation?
It is not that COW is non-conforming, it is that COW is problematic and
often does not deliver the ROI expected of it.
>[Note: the current spec does not specify the validity of the pointer
>returned by any_cast. Therefore it should be interpreted to be valid until
>the next 'any' operation. I think that this can be strengthened to 'the next
>non-const operation' and a COW implementation would still conform.]
I think this is a weakness and oversight in the current specification
for 'any' (so thanks for pointing this one out!) rather than a loophole
to be exploited.
std::basic_string got into serious trouble playing this game -- and even
as the person who put in the most recent DR that relates to this issue,
I am still not entirely convinced that all is well with the patient :-}
Kevlin Henney phone: +44 117 942 2990
mailto:kevlin_at_[hidden] mobile: +44 7801 073 508
http://www.curbralan.com fax: +44 870 052 2289
Curbralan: Consultancy + Training + Development + Review
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk