|
Boost Users : |
From: Nat Goodspeed (ngoodspeed_at_[hidden])
Date: 2007-05-08 11:19:47
> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Meryl Silverburgh
> Sent: Tuesday, May 08, 2007 10:41 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] Pointer in function parameter?
>
> But what if I have
>
> void aFunc(const A* aPtr) {
> // access aPtr
> }
>
> should I change it to
>
> void aFunc(const shared_ptr<A> aPtr) {
> // access aPtr
> }
[Nat] 'const A*' is "pointer to const A".
'const shared_ptr<A>' is "const shared_ptr to non-const A".
You probably want 'shared_ptr<const A>'.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net