How can I get a reference from a boost smart pointer?
16 Jul
2008
16 Jul
'08
12:12 a.m.
Hi, I have a pointer to a class: A* aPt; and I deference it to pass that as a reference void aFunction(A& aRef); and I call aFunction(*aPt); but if I switch to use boost smart pointer how can I de-reference it and call aFunction()? shared_ptr<A> aPt; I tried: aFunction(aPt); // does not compile aFunction(aPt->get()); // does not compile. Thank you for any help.
16 Jul
16 Jul
12:21 a.m.
New subject: How can I get a reference from a boost smart pointer?
AMDG Meryl Silverburgh wrote:
but if I switch to use boost smart pointer how can I de-reference it and call aFunction()?
Deference it just as you would a raw pointer: aFunction(*aPtr) In Christ, Steven Watanabe
5966
Age (days ago)
5966
Last active (days ago)
1 comments
2 participants
participants (2)
-
Meryl Silverburgh
-
Steven Watanabe