At 05:47 PM 1/27/2003, Andrei Alexandrescu wrote:
>Q. Why doesn't shared_ptr provide (your pet feature here)?
>A. Because (your pet feature here) would mandate a reference counted
>implementation or a linked list implementation, or some other specific
>implementation. This is not the intent.
>
>This is a presupposition. Someone wants to mandate lazy
>initialization/specific dereference testing/specific initialization
>testing/tons others. Would any of these require a refcounted/reflinked
>implementation?
That particular FAQ item was written quite a while ago, before weak_ptr
support, before custom deleter support, etc. We had gotten several requests
for features that seemed to tilt the spec strongly toward one or the other
of the implementation techniques.
The question of whether "any of these require a refcounted/reflinked
implementation?" is a good one.
The question came up with use_count(), and was handled by not requiring
use_count() be constant complexity.
For a shared-ownership smart pointer with weak_ptr support, I expect some
people will say that mandates a refcounted rather than reflinked
implementation. I don't think that is true, but it may make a reflinked
implementation less attractive. What's your opinion on that?
--Beman
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
- [boost] Deadline for the Standard Library Technical Re... Beman Dawes
- [boost] Re: Deadline for the Standard Library Tec... Jeffrey Yasskin
- Re: [boost] Re: Deadline for the Standard Lib... Beman Dawes
- [boost] Re: Deadline for the Standard Lib... Andrei Alexandrescu
- Re: [boost] Re: Deadline for the Stan... William E. Kempf
- [boost] Re: Deadline for the Standard... Edward Diener
- [boost] Re: Deadline for the Sta... David B. Held
- Re: [boost] Re: Deadline for... Greg Colvin
- [boost] Re: Re: Deadline... David B. Held
- Re: [boost] Re: Deadline for the Stan... Greg Colvin
- [boost] Re: Re: Deadline for the Stan... Beman Dawes
- [boost] Re: Re: Deadline for the... Andrei Alexandrescu
- Re: [boost] Re: Re: Deadline... Peter Dimov
- [boost] Re: Deadline for... Andrei Alexandrescu
- Re: [boost] Re: Deadline... Peter Dimov
- [boost] Re: Re: Deadline... David B. Held
- Re: [boost] Re: Re: Dead... David Abrahams
- Re: [boost] Re: Re: Dead... Gabriel Dos Reis
- Re: [boost] Re: Re: Dead... David Abrahams
- Re: [boost] Re: Re: Dead... Gabriel Dos Reis
- Re: [boost] Re: Re: Dead... Beman Dawes