At 09:46 PM 2/2/2003, Howard Hinnant wrote:
>Could someone review the motivations for wanting an implicit conversion
>to T* ? I'm failing to come up with any myself.
It is useful when it is desirable for the smart pointer to mimic a built-in
pointer as closely as possible.
One case where that happens is when making extensive use of a third-party
library which passes a lot of arguments as raw pointers. Writing p.get() a
great deal tends to make code less readable.
Another case is when trying to toughen up legacy code by replacing a raw
pointer variable with a smart pointer. Changes are minimized if the smart
pointer mimics a raw pointer closely.
To me, a major benefit of a policy based design is to be able to
accommodate a wide range of features, including those which find only
limited use.
If a policy based smart pointer can't accommodate a wide range of features,
I start to wonder if the design itself is inflexible and flawed. That's why
I worry a lot about whether a given PBSP design can handle apparently
marginal uses.
--Beman
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
- Re: [boost] Re: SmartPtr (Loki) - auto_ptr/move c'tor ... Beman Dawes
- [boost] Re: SmartPtr (Loki) - auto_ptr/move c'tor issu... David B. Held
- Re: [boost] Re: SmartPtr (Loki) - auto_ptr/move c'tor ... Beman Dawes
- [boost] Re: SmartPtr (Loki) - auto_ptr/move c'tor issu... David B. Held
- [boost] Array support [was SmartPtr (Loki) - auto_ptr/... Beman Dawes
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... David Abrahams
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... Beman Dawes
- [boost] Re: Array support [was SmartPtr (Loki) - auto_... David B. Held
- [boost] Re: Array support [was SmartPtr (Loki) - auto_... David B. Held
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... Howard Hinnant
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... Beman Dawes
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... Howard Hinnant
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... Beman Dawes
- [boost] Re: Array support [was SmartPtr (Loki) - auto_... Andrei Alexandrescu
- Re: [boost] Re: Array support [was SmartPtr (Loki) - ... Beman Dawes
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... David Abrahams
- Re: [boost] Array support [was SmartPtr (Loki) - auto_... Beman Dawes
- [boost] Re: Array support [was SmartPtr (Loki) - auto_... Andrei Alexandrescu
- Re: [boost] Re: Array support [was SmartPtr (Loki) -au... Peter Dimov
- [boost] Re: Array support [was SmartPtr (Loki) - auto_... Howard Hinnant
- [boost] Re: Array support [was SmartPtr (Loki) -auto_p... Andrei Alexandrescu