|
Boost :
|
- Next message: Alkis Evlogimenos: "Re: [boost] boost build on redhat7.3"
- Previous message: David Abrahams: "Re: [boost] [type traits] Doc nitpick & add_reference question"
- Next in thread: David B. Held: "[boost] Re: Re: [smart_ptr] const-correctness as function argument"
- Reply: David B. Held: "[boost] Re: Re: [smart_ptr] const-correctness as function argument"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
> No, that wont work. That would still require it's base to be
> copied--the same copy that occurs already.
It works because I've done it with my own "smart" pointers.
Oliver
> "Schoenborn, Oliver" <Oliver.Schoenborn_at_[hidden]> wrote in message
> news:35C5DD9F60FED21192B00004ACA6E6C70151C87D_at_nrclonex1.imti.nrc.ca...
> > > >
> > > I haven't looked real close, but doesn't the subsection titled
> > > "Smart Pointers and const" in Item 28 of Scott Meyers
> > > _More Effective C++_ contain a solution to this problem?
> > > Basically, it describes SmartPtr<T> derived from
> > > SmartPtrToConst<T> and SmartPtrToConst<T> containing
> > > a union of const and non-const pointers to T. Unfortunately,
> > > this would require changing shared_ptr.
> >
> > Another option is to have shared_ptr<T> inherit non-publicly from
> > shared_ptr<const T>, with a method to get a reference to the base. This
> > requires a little bit more maintenance of code since pretty much all of
> > the methods of the derived have to be forwarded to the base,
> > but it's not excruciating either. It avoids the copy construction too.
- Next message: Alkis Evlogimenos: "Re: [boost] boost build on redhat7.3"
- Previous message: David Abrahams: "Re: [boost] [type traits] Doc nitpick & add_reference question"
- Next in thread: David B. Held: "[boost] Re: Re: [smart_ptr] const-correctness as function argument"
- Reply: David B. Held: "[boost] Re: Re: [smart_ptr] const-correctness as function argument"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
- Maybe reply: Schoenborn, Oliver: "RE: [boost] Re: [smart_ptr] const-correctness as function argumen t"
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk